Maximum and Minimum monoids
strake888 at gmail.com
Fri Dec 28 20:57:02 CET 2012
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
> 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.
More information about the Libraries