Data.Map, Data.IntMap documentation

Isaac Dupree isaacdupree at
Sun Aug 19 06:44:53 EDT 2007

I wrote:
> Maybe there should be a separate FloatOrd class if you want the fourth 
> possibility of "false due to NaN" in your comparisons of floating-point 
> numbers, so that Float/Double can be made proper members of PrimOrd.

Then there are non-total orderings such as subset relations or many 
lattices... which often get demoted to using `lt` and `gt` symbols.

Of course, Floats are not well-behaved even in Eq.
   Prelude> let x = 0/0 :: Double in x == x
And there is no simple operation based on their (<), (<=)... that 
fulfills even the requirements for a partial order... 
A newtype of them that becomes _|_ upon isNaN would make a true total 
order AFAIK (the infinities -at least in IEEE arithmetic- are 
well-behaved with respect to ordering and equalling themselves).


More information about the Libraries mailing list