Hey everyone! I want to pass a bytestring to the unpack
function in the module Data.ByteString.Lazy
. After I tried few ways I find that I can only obtain a byte string in Haskell by using pack
function in the same module and pass a Word8
list to it.
Is there anyway I can directly write a bytestring in Haskell just like I write a normal list [1, 2, 3]
?
Edit : According to the book Learn You a Haskell For Great Good, bytestring seems to be represented by :
Chunk "can" Empty
Since we have the following example in the book :
ghci> B.pack [99,97,110]
Chunk "can" Empty
But my ghci prompt shows the following :
λ> B.pack [99,97,110]
"can"