Proposal: Max and Min for Monoid (ticket # 1952)

Ian Lynagh igloo at earth.li
Sun Dec 2 14:26:05 EST 2007


On Sun, Dec 02, 2007 at 09:57:50AM -0800, Conal Elliott wrote:
> 
> instance (Ord a, Bounded a) => Monoid (Min a) where
> 	mempty = Min minBound

I think you mean:

    mempty = Min maxBound

> 	Min a `mappend` Min b = Min (a `min` b)


Thanks
Ian



More information about the Libraries mailing list