[Haskell-cafe] Re: [Haskell] ANN: The Typeclassopedia, and request for feedback

wren ng thornton wren at freegeek.org
Mon Feb 16 22:13:04 EST 2009

Isaac Dupree wrote:
> Natural numbers under min don't form a monoid, only naturals under max do (so 
> you can have a zero element)

Though, FWIW, you can use Nat+1 with the extra value standing for 
Infinity as the identity of min (newtype Min = Maybe Nat).

I bring this up mainly because it can be helpful to explain how we can 
take the "almost monoid" of min at Nat and monoidize it. Showing how this 
is similar to and different from max at Nat is enlightening. Showing the 
min monoid on negative naturals with 0 as the identity, and no need for 
the "special" +1 value, would help drive the point home. (Also, the 
min/max duality is mirrored in intersection/union on sets where we need 
to introduce either the empty set (usually trivial) or the universal set 
(usually overlooked).)

Or maybe that would be better explained in a reference rather than the 
main text.

Live well,

More information about the Haskell-Cafe mailing list