[Haskell-cafe] Deducing Show for GADTs

David Roundy droundy at darcs.net
Wed Jun 28 06:33:25 EDT 2006

On Wed, Jun 28, 2006 at 11:52:51AM +0200, Joel Bjrnson wrote:
> Hi. I came a cross the following phenomena which, at least to me,
> occurs kind of awkward. The code below:
> data MyData a  where
>  DC1 :: (Show a ) => a -> MyData a

GADTs don't yet work right with classes.  :( The above, however,
doesn't need to be expressed as a GADT, I believe you can write
something like:

data MyData a = (forall a. Show a) => DC1 a

which (this is untested) should do what you want.
David Roundy

More information about the Haskell-Cafe mailing list