[Haskell-cafe] Combining Wouter's expressions with extensible records

Antoine Latter aslatter at gmail.com
Wed Jul 9 23:01:49 EDT 2008


On Wed, Jul 9, 2008 at 9:40 PM, Ron Alford <ronwalf at volus.net> wrote:
> Ok, but to make it part of a record, it needs to implement Data:
> data Expr f = In (f (Expr f)) deriving Data
>
> but this gives
>    No instances for (Data (f (Expr f)), Typeable (Expr f))
>      arising from the 'deriving' clause of a data type declaration
>                   at Planning/Wouter.hs:77:0-42

The Data class has a requirement that any instances are also instances
of Typeable, so you'd really want

> data ... = ...  deriving (Data, Typeable)

Except that I couldn't derive Typeable for your particular data type.

It isn't immediately obvious to me that the "Typeable" family of
classes deal at all with higher-kinded type constructors, but I didn't
look that hard.

-Antoine


More information about the Haskell-Cafe mailing list