[Haskell-cafe] Data structure containing elements which are instances of the same type class
aslatter at gmail.com
Sat Aug 11 21:01:38 CEST 2012
It should be pretty easy to write an adapter function of type "String ->
(Show a => a)".
On Aug 11, 2012 12:34 PM, "Patrick Palka" <patrick at parcs.ath.cx> wrote:
> 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
> 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)?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe