instance Ord FiniteMap

Johannes Waldmann joe@isun.informatik.uni-leipzig.de
Wed, 29 May 2002 08:13:38 +0200 (MET DST)


> for instance, Sets of Sets of things would be really nice.

Sure. One could simply use lexicographic ordering
(i. e.  s1 `compare` s2 = setToList s1 `compare` setToList s2)
or length-lexicographic ordering (for efficiency)
 ... = (cardinality s1, setToList s1) `compare` (cardinality s2, setToList s2)

As you write, there seems to be no reason not to do this.
An Ord instance should be a linear ordering, and the above are.
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --