[Haskell-cafe] Data structure containing elements which are instances of the same type class

Patrick Palka patrick at parcs.ath.cx
Sat Aug 11 19:33:35 CEST 2012


On Sat, Aug 11, 2012 at 4:14 AM, <oleg at okmij.org> wrote:

>
> I'd like to point out that the only operation we can do on the first
> argument of MkFoo is to show to it. This is all we can ever do:
> we have no idea of its type but we know we can show it and get a
> String.
>

That's not all you can do: you can also pass the first argument of MkFoo to
a function that expects a Show a => a argument, like the function 'print'.
Can you do that with just a String (that represents show x for some x)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120811/98b529ab/attachment.htm>


More information about the Haskell-Cafe mailing list