> You can't do it in standard Haskell, but with ghc extensions you can
> achieve the same effect.  For example, the following program
> 
>       data Showable = forall a . Show a => Showable a
>       instance Show Showable where
>               show (Showable x) = show x
>       example = map show [Showable 'a', Showable 5]
>       main = print example
> 
> produces the output
> 
>       ["'a'","5"]

And it isn't just ghc that has this extension.  Hugs98 and nhc98
also implement it with this syntax.  Hbc has the extension too (local
forall quantification), but uses a slightly different syntax, since
its implementation pre-dates all the others.

Regards,
    Malcolm

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to