
6 Nov
2010
6 Nov
'10
8:30 a.m.
Hi, I was trying to put a String in a ByteString import qualified Data.ByteString.Lazy as BS message :: BS.ByteString message = runPut $ do let string="SOME STRING" map (putWord8.fromIntegral.ord) string -- this ofcourse generates [Put] How can I convert the list of Put's such that it could be used in the Put monad? For now I used the workaround of first converting the string to ByteString like this - stringToByteString :: String -> BS.ByteString stringToByteString str = BS.pack (map (fromIntegral.ord) str) and then using putLazyByteString inside the Put monad. -- Regards, Kashyap