Daniel Fischer wrote:
> No, the instance head is just a type variable, not a type constructor
> applied to type variables

Oops, you're right. GHC was telling the truth, I should have
paid closer attention!

Fixing my minimal example, I get:

{-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-}
module ClassContextBug where
class A a oops
class B b
data D d = D d
instance A a oops => B (D a)

and now GHC compiles it happily.

So it's the derived Read instance in this context that
is causing the problem. Here is a slightly smaller test
case that triggers the bug:

{-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-}
module Bug where
class A a oops
data D d = D d
instance A a oops => Read (D a)
data E e = E (D e) deriving Read

Thanks,
Yitz

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

Reply via email to