我想拆分ByteString
成这样的词:
import qualified Data.ByteString as BS
main = do
input <- BS.getLine
let xs = BS.split ' ' input
但似乎 GHC 无法自行将字符文字转换为Word8
,所以我得到了:
Couldn't match expected type `GHC.Word.Word8'
with actual type `Char'
In the first argument of `BS.split', namely ' '
In the expression: BS.split ' ' input
Hoogle 没有找到任何具有类型签名的内容,Char -> Word8
并且Word.Word8 ' '
是无效的类型构造函数。关于如何解决它的任何想法?