Maximum and Minimum monoids
Edward Kmett
ekmett at gmail.com
Fri Dec 28 22:11:24 CET 2012
And they are already present in the semigroups package with those names and
that Monoid.
On Fri, Dec 28, 2012 at 2:57 PM, Strake <strake888 at gmail.com> wrote:
> On 28/12/2012, Roman Cheplyaka <roma at ro-che.info> wrote:
> > 1. Actually, Max and Min are already there. No need to rename or do
> > anything.
> >
> > ...
> >
> > So, the best solution seems to be to merge semigroups into base.
> > My proposal would be to move only Data.Semigroup to base, as it will
> > lead to significant simplification, but leave other modules (NonEmpty,
> > Natural) in a separate package, since they are of limited applicability
> > and would gain nothing by being inside base.
>
> Agree. If we do so, we can thus define these:
>
> instance (Ord a, Bounded a) => Monoid (Max a)
> instance (Ord a, Bounded a) => Monoid (Min a)
>
> no Maybe wrapper needed, and "Max" and "Min" are brief.
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20121228/86155839/attachment-0001.htm>
More information about the Libraries
mailing list