haskell extensions question

Diego Yanivello diegoy at sol.info.unlp.edu.ar
Mon Dec 1 00:59:08 EST 2003


hi,
   I am using the haskell extensions (in Hugs - Nov 2002) and I have some 
troubles with that. For example:

class A a where
    a :: a -> String
    a = const "a"

class B b where
    b :: b -> String
    b = const "b"

instance (A b) => B b where
    b = a

instance B ()

-----------------
In this case, Hugs says:

ERROR "Test.hs":12 - Overlapping instances for class "B"
*** This instance   : B ()
*** Overlaps with   : B a
*** Common instance : B ()

but I don't have an instance "A ()" from which haskell can infer an 
instance "B ()".
can somebody explain me that it is happening here?

Thanks in advanced...

     Diego



More information about the Haskell mailing list