[Haskell-beginners] show vs. Data.ByteString.Char8.unpack for ByteString

Stephen Blackheath [to Haskell-Beginners] mutilating.cauliflowers.stephen at blacksapphire.com
Thu Feb 4 16:08:41 EST 2010


Hong,

'show' of a ByteString will put quotes around the text and lots of \ for
escaping certain characters, whereas unpack will translate each byte
one-to-one to a Char.


Steve

Hong Yang wrote:
> Hi,
> 
> What is the difference between show and unpack when the function
> arguments are of ByteString type? I thought they are the same, but they
> are not interchangeable at compile time.
> 
> Thanks,
> 
> Hong
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners


More information about the Beginners mailing list