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

Isaac Dupree isaacdupree at
Mon Dec 3 11:45:22 EST 2007

Ross Paterson wrote:
> data Max a = NoMax | Max a
> 	deriving (Eq, Ord, Read, Show)

> and similarly for Min.

data Min a = Min a | NoMin
so that the deriving Ord works as expected

The newtypes don't add a possible bottom, but data does... should (Max 
undefined) be non-bottom, or should the data types have strictness 
annotations perhaps?


More information about the Libraries mailing list