Thursday, September 19, 2013

Haskell differenct in showing Data.Text

Haskell differenct in showing Data.Text

Consider the next code in GHCi:
*> data R = R { s :: Text }
*> instance Show R where show x = unpack $ s x
*> let r = R $ pack "¶"
*> r

*> s r
"\182"
Why does it shows the paragraph sign without the quotes and when showing R
datatype. And showing like [Char] (actually, :t s r is Text) when showing
s r?

No comments:

Post a Comment