[Haskell-cafe] Possible bug in GHC 7.0.3

Daniel Fischer daniel.is.fischer at googlemail.com
Wed Jun 29 11:58:55 CEST 2011

On Wednesday 29 June 2011, 11:37:39, Yitzchak Gale wrote:
> 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

Just for the record, same panic with 7.0.2 and 7.0.4 (and deriving Show or 
Eq too).
6.12.3 reports:

    Can't derive instances where the instance context mentions
    type variables that are not data type parameters
      Offending constraint: A e oops
    When deriving the instance for (Read (E e))

which seems reasonable.

More information about the Haskell-Cafe mailing list