Ben Rudiak-Gould wrote:
I just realized that the class Ord should have an additional method:

  class Eq a => Ord a where
    compares :: a -> a -> Ordering -> Ordering
    compares x y d = case compare x y of { EQ -> d ; o -> o }
    ...

How about:

instance (Ord a, Ord b, Ord c, Ord d) => Ord (a,b,c,d) where
        compare (a1,b1,c1,d1) (a2,b2,c2,d2) =
                compare ((a1,b1,c1),d1) ((a2,b2,c2),d2)

or another tuple nesting)

Christian
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to