[Haskell-cafe] question about GADT and deriving automatically a Show instance

TP paratribulations at free.fr
Sat May 18 16:23:00 CEST 2013


Denis Kasak wrote:

> Note that all of this would work even without explicit quantification
> since you
> have already specified that Person accepts an argument of kind Gender. In
> other
> words, this works as expected:
> 
> data Person :: Gender -> * where
>     Dead :: Person a
>     Alive :: { name :: String
>              , weight :: Float
>              , father :: Person b } -> Person a
> 
> deriving instance Show (Person a)

Thanks so much, it is now perfectly clear. A lot of things learned with this 
dummy example.

TP






More information about the Haskell-Cafe mailing list