[Haskell-cafe] Re: [Haskell] pros and cons of static typing and side effects ?

Benjamin Franksen benjamin.franksen at bessy.de
Tue Aug 16 16:15:11 EDT 2005

On Tuesday 16 August 2005 21:56, Keean Schupke wrote:
> You can even use existential types to create lists of things with a
> common interface, where you do not know in advance what types you may
> need:
>     data XWrap = XWrap (forall a . Show a => a)
>     type ListXWrap = [XWrap]

You probably meant to write

    data XWrap = forall a . Show a => XWrap a

or, in GADT style (which I find a bit more intuitive here):

    data XWrap where
      XWrap :: Show a => a -> XWrap


More information about the Haskell-Cafe mailing list