Data.Map, Data.IntMap documentation

Isaac Dupree isaacdupree at
Sat Aug 18 07:47:43 EDT 2007

Twan van Laarhoven wrote:
> Now the Data.Map functions can be based on PrimOrd, because we don't 
> actually care about the ordering. Except for to/fromAscList, which 
> should check the ordering is actually an Ord.

and toList and fold, even for associative-commutative operations, 
because it can't know.  Also it might be fair to lift the nondeterminism 
to IO, e.g. you could define your program's semantics to output these 
elements in an arbitrary unpredictable order.

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.


More information about the Libraries mailing list