[英]Haskell : convert a bytestring to [word8]
my intent is to convert a bytestring
to a List of Word8
in haskell in order to get access to the LSB for each byte
. 我的目的是将一个
bytestring
转换为haskell中List of Word8
以便获取每个byte
的LSB。
any idea how to achieve that ? 知道如何实现吗?
unpack :: ByteString -> [Word8]
http://hackage.haskell.org/package/bytestring-0.10.8.1/docs/Data-ByteString.html#v:unpack http://hackage.haskell.org/package/bytestring-0.10.8.1/docs/Data-ByteString.html#v:unpack
Also consider whether you can skip the intermediate list, and directly use foldl'
or some related fold. 还考虑是否可以跳过中间列表,而直接使用
foldl'
或一些相关的折叠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.