We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We use both lazy and strict version interchangeably everywhere. We need to stick to one. I have a feeling that the lazy version might work everywhere.
See http://blog.ezyang.com/2010/08/strings-in-haskell/ for some additional info.
The text was updated successfully, but these errors were encountered:
Example:
handShakeMsg :: InfoDict -> String -> ByteString handShakeMsg m peer_id = let pstrlen = concat $ toChunks $ Bin.encode (19 :: Int8) pstr = pack "BitTorrent protocol" reserved = replicate 8 '\0' infoH = infoHash m peerID = pack peer_id in concat [pstrlen, pstr, reserved, infoH, peerID]
Bin.encode returns the lazy version, and concat . toChunks makes it strict. This might be unnecessary.
Bin.encode
concat . toChunks
Ref: http://stackoverflow.com/questions/1451755/many-types-of-string-bytestring
Sorry, something went wrong.
No branches or pull requests
We use both lazy and strict version interchangeably everywhere. We need to stick to one. I have a feeling that the lazy version might work everywhere.
See http://blog.ezyang.com/2010/08/strings-in-haskell/ for some additional info.
The text was updated successfully, but these errors were encountered: