On Tue, 2010-11-02 at 21:57 -0400, Brandon S Allbery KF8NH wrote: > On 10/29/10 09:35 , Dominique Devriese wrote: > > * Only introduce a dependency from type class A to type class B if all > > functions in type class B can be implemented in terms of the > > functions in type class A or if type class A is empty. > > Er? Eq a => Ord a makes perfect sense in context but violates this law.
x == y = case x `compare` y of EQ -> True; _ -> False Or using (==) inside definition: (==) = ((== EQ) .) . compare Class A - Ord, B - Eq. Regards
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe