On 11/6/10 6:38 AM, C K Kashyap wrote:
Thanks a lot Gregory and Daniel,

I think I'll go with the "mapM_ (putWord8 . fromIntegral . ord)" approach.


If your string has any chance of containing Unicode characters then you will want to use the "encode" function in the module "Codec.Binary.UTF8.String" in the package "utf8-string", so that the code becomes

    mapM_ putWord8 . encode

Cheers,
Greg
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to