Deriving regression or bad code?

Ron Alford ronwalf at
Thu Apr 8 01:39:23 EDT 2010

I've attached the simplest example of my code that used to compile in
GHC 6.10 now gives the error in GHC 6.12.1:
    No instances for (Data Const, Data Var)
      arising from the 'deriving' clause of a data type declaration
                   at baddata.hs:33:14-17
    Possible fix:
      add an instance declaration for (Data Const, Data Var)
      or use a standalone 'deriving instance' declaration instead,
         so you can specify the instance context yourself
    When deriving the instance for (Data (Domain e g))

If I replace:
> data Domain e g = Domain
>     (Expr (Const :+: Var))
>     deriving (Data, Typeable)

> data Domain e g = Domain
>    (Expr (Const))
>    deriving (Data, Typeable)

then everything compiles.  If nothing else, the error message is misleading.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: baddata.hs
Type: application/octet-stream
Size: 1072 bytes
Desc: not available
Url :

More information about the Glasgow-haskell-users mailing list