Fwd: [Haskell-cafe] x -> String

Alberto G. Corona agocorona at gmail.com
Fri Oct 16 15:15:06 EDT 2009


yep
add  Show to your abstrac container. , for example:

data SDynamic=  forall a.Show a => SDynamic a

instance Show SDynamic where
     show (SDynamic a)= show a

2009/10/16 David Virebayre
<dav.vire+haskell at gmail.com<dav.vire%2Bhaskell at gmail.com>
>

On Fri, Oct 16, 2009 at 8:19 PM, Andrew Coppin
> <andrewcoppin at btinternet.com> wrote:
> > Is there any way that you can turn an arbitrary Haskell value into a
> string?
>
> > I rephrase: There *is* a way to turn arbitrary values into strings. I
> know
> > there is, because the GHCi debugger *does* it. The question is, does
> anybody
> > know of an /easy/ way to do this?
>
> Ghci only displays values with a Show instance.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091016/6c2b07a0/attachment.html


More information about the Haskell-Cafe mailing list