The hackage documentation for ByteString contains this example:
split :: Word8 -> ByteString -> [ByteString]
split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
It's as if '\n'
is converted to a Word8
, but LANGUAGE OverloadedStrings
seems only to work on strings, not chars. What extension to I need to include for the example code to work?
bytestring
supports a cheap and cheerful Latin1 view of the bytes. You can import Data.ByteString.Char8 to get that view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With