Haskell: Does ghci show "Chunk .. Empty"?
To teach you in Haskell there is an example code:
ghci> B.pack [99,97,110] Chunk "can" Empty ( B stands for Data.ByteString.Lazy )
But my ghci does not show Chunk and Empty data constructors.
> B.pack [99,97,110] "can" Have Haskell developers developed a way to print ByteString values?
It looks like Duncan added a handwritten copy of Show for lazy ByteString somewhere between 0.9.2.1 and 0.10.0.1 . See http://hackage.haskell.org/packages/archive/bytestring/0.10.2.0/doc/html/src/Data-ByteString-Lazy-Internal.html#ByteString
Add: Here is the corresponding patch
In older versions of BL.ByteString simple there is a deriving Show in the data declaration. This causes the GHCi to exit, as shown in LYAH, and ensures that the exit is valid Haskell code. The nice simple "can" string is not really a valid Haskell representation of this byte string, that is, an invalid Haskell 98 representation. However, modules using bytestrings typically use {-# LANGUAGE OverloadedStrings #-} , which makes it valid. This is probably the reason why now (from 0.10 ) this is a more readable instance manually.