
On Sun, Jan 9, 2011 at 6:05 PM, Aaron Gray
On 9 January 2011 21:30, Henning Thielemann
wrote: On Sun, 9 Jan 2011, Aaron Gray wrote:
I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am looking for good examples of usage.
What do you intend to do with them?
An (ABC) ActionScript Byte Code backend for Haskell. Basically I need to write little-endian binary to a file, and was wondering the best way to do this; I need various types including a 24bit type.
Ah, I would recommend the 'binary' package on hackage, specifically the module Data.Binary.Builder. Another recently popular alternative is the 'blaze-builder' package. Although the 24-bit access might be difficult - how are they aligned? I guess with either of these you'd have to peek a Word8 and then a Word16 and then munge them together, depending. Antoine http://hackage.haskell.org/package/binary http://hackage.haskell.org/package/blaze-builder
The package storablevector uses a lot of Ptr, peek, and poke. Maybe this is of some help.
Okay thanks, Aaron
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe