[Haskell-cafe] Writing binary files

Neil Mitchell ndmitchell at gmail.com
Mon Aug 21 08:25:03 EDT 2006


Hi,

I'm trying to write out a binary file, in particular I want the
following functions:

hPutInt :: Handle -> Int -> IO ()

hGetInt :: Handle -> IO Int

For the purposes of these functions, Int = 32 bits, and its got to
roundtrip - Put then Get must be the same.

How would I do this? I see Ptr, Storable and other things, but nothing
which seems directly useable for me.

Thanks

Neil


More information about the Haskell-Cafe mailing list