简体   繁体   English

Haskell:将字节字符串转换为[word8]

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM