标签: haskell bytestring
ByteString的hackage文档包含此example:
split :: Word8 -> ByteString -> [ByteString] split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
好像'\n'转换为Word8,但LANGUAGE OverloadedStrings似乎只能处理字符串,而不是字符。我需要包含哪些扩展才能使示例代码生效?
'\n'
Word8
LANGUAGE OverloadedStrings
答案 0 :(得分:3)
bytestring支持廉价而欢快的Latin1字节视图。您可以导入Data.ByteString.Char8以获取该视图。
bytestring