
18 Aug
2007
18 Aug
'07
7:47 a.m.
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. Isaac