[Haskell-cafe] Trying to make a Typeable instance

Adrian Hey ahey at iee.org
Sun Jul 8 09:17:35 EDT 2007

Neil Mitchell wrote:
>> data ListGT map k a
>>   = Empt
>>   | BraF ![k] a !(map (ListGT map k a))
>>   | BraE ![k]   !(map (ListGT map k a))
>>    deriving( Typeable )
> Not in Haskell, only in GHC.

Thanks for the suggestions from Hugh and Neil. I tried this anyway
and it doesn't work even with ghc I'm afraid..

> Can't make a derived instance of `Typeable (ListGT map k a)'
>  (`ListGT' has arguments of kind other than `*')
> When deriving instances for `ListGT'

So it seems ghc doesn't like kinds (* -> *) either :-(

Actually, AFAICT the problem seems to be with Data.Typeable
itself rather than ghc. There is no proper TypeRep for
(ListGT map k a) because map is not a type.

Or maybe I'm missing something. Is it possible to make correct
instances of Typeable for types like this?

What would Data.Derive make of this?

Thanks for any thoughts or insight
Adrian Hey

More information about the Haskell-Cafe mailing list