Maximum and Minimum monoids

Ben Millwood haskell at benmachine.co.uk
Sun Dec 30 01:25:20 CET 2012


On Sat, Dec 29, 2012 at 11:18 PM, wren ng thornton <wren at freegeek.org> wrote:
> Please please, if we're going to abbreviate mathematical terms then we
> ought to stick to the standard mathematical abbreviations: sup, inf.

Agreed.

> Personally, I'm fine with Min and Max as they are, because in particular
> they capture the fact that we're dealing with total orders here. That is,
> other than for empty sets, they do in fact return the maximum/minimum.
> Whereas Sup and Inf bring to mind the fact that what we're dealing with is
> a complete lattice, which need not be a total order. While Sup and Inf
> make perfectly good monoids/semigroups, I'd prefer if they properly allow
> all complete lattices rather than being unnecessarily restricted to Ord.

I think your concerns here are legitimate, but I have to agree with
Herbert that reference "maximal element" is problematic.

Is there anything wrong with just using the Max semigroup and, e.g.
`sconcat . (minBound :|)`, or something similar?



More information about the Libraries mailing list