Deriving regression or bad code?

Ron Alford ronwalf at volus.net
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:
baddata.hs:33:14:
    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)

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

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

-Ron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: baddata.hs
Type: application/octet-stream
Size: 1072 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20100408/67d2b217/baddata.obj


More information about the Glasgow-haskell-users mailing list