Maximum and Minimum monoids
Gershom Bazerman
gershomb at gmail.com
Fri Dec 28 07:30:36 CET 2012
On 12/28/12 1:20 AM, Michael Snoyman wrote:
>
>
> +1 for moving semigroups into the platform, but what's the motivation
> for removing First and Last from Data.Monoid?
>
Because they're properly represented as semigroups too, just like Min
and Max (i.e. they don't behave sensibly "out of the box" on empty
lists). The semigroups package already provides the proper types and
instances. And just like Min and Max, the semigroups package lets you
"lift" its First and Last into Monoids with the Option type.
--Gershom
More information about the Libraries
mailing list