[Haskell-cafe] Help needed for converting IOArray to ByteString

C K Kashyap ckkashyap at gmail.com
Tue Feb 8 09:49:38 CET 2011

I need to convert IOArray to bytestring as shown below -

import Data.Array.IO
import Data.Binary.Put
import qualified Data.ByteString.Lazy as BS
import Data.Word

main = do
arr <- newArray (0,9) 0 :: IO (IOArray Int Int)
let bs=toByteString arr
return ()

How can I implement the 'toByteString' function?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110208/d81ae9dd/attachment.htm>

More information about the Haskell-Cafe mailing list