[Haskell-cafe] question about show

Clark Gaebel cgaebel at uwaterloo.ca
Wed Mar 5 21:46:48 UTC 2014


"Show" is for debug output. It's not a generic "to_string". See this thread
[1] from last week for more info.

  - Clark

[1] https://groups.google.com/forum/#!topic/haskell-cafe/32EeI96b1VQ


On Wed, Mar 5, 2014 at 4:43 PM, <k at ioctl.it> wrote:

> Hello!
>
> I'm sure this has been answered many times before, but I can't find an
> explanation for this behavior anywhere. The question I have is a general
> one regarding 'show'. Why does
>
> main = do
>     putStrLn "ü"
>
> ➜  ~ runhaskell test.hs
> ü
>
>
> and:
>
> main = do
>     putStrLn $ show "ü"
>
> ➜  ~ runhaskell test.hs
> "\252"
>
> Thank you all for an enlightening answer already!
>
> Best,
>
> k
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Clark.

Key ID     : 0x78099922
Fingerprint: B292 493C 51AE F3AB D016  DD04 E5E3 C36F 5534 F907
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140305/1265abf0/attachment.html>


More information about the Haskell-Cafe mailing list