Cannot build superclass instance

Johannes Waldmann joe@isun.informatik.uni-leipzig.de
Thu, 28 Jun 2001 16:45:34 +0200 (MET DST)


The following program

import Complex

instance Ord a => Ord (Complex a) where 
    (x1 :+ y1) `compare` (x2 :+ y2)  = (x1, y1) `compare` (x2, y2)

gives the message

ERROR Bug.hs:3 - Cannot build superclass instance
*** Instance            : Ord (Complex a)
*** Context supplied    : Ord a
*** Required superclass : Eq (Complex a)

What is hugs' problem here? It compiles with ghc. 
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --