【发布时间】:2014-12-22 08:11:47
【问题描述】:
ByteString 的hackage 文档包含这个example:
split :: Word8 -> ByteString -> [ByteString]
split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
好像'\n' 被转换为Word8,但LANGUAGE OverloadedStrings 似乎只适用于字符串,而不适用于字符。我需要包含什么扩展才能使示例代码正常工作?
【问题讨论】:
-
如果我尝试该示例,则会导致错误。
Couldn't match expected type 'Word8' with actual type 'Char' In the first argument of 'split', namely '\n'
标签: haskell bytestring