[Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

Antoine Latter aslatter at gmail.com
Mon Jan 10 03:52:56 CET 2011


On Sun, Jan 9, 2011 at 8:11 PM, Aaron Gray <aaronngray.lists at gmail.com> wrote:
> On 10 January 2011 01:08, Antoine Latter <aslatter at gmail.com> wrote:
>>
>> Although the 24-bit access might be difficult - how are they aligned?
>>
>
> They are non aligned, they are actually used as jump offsets in the byte
> code.
>

Hah hah, yes. That would make a lot more sense.

>>
>> I guess with either of these you'd have to peek a Word8 and then a
>> Word16 and then munge them together, depending.
>
> Three put/getWord8's would probably be neater.
>>
>> http://hackage.haskell.org/package/binary
>> http://hackage.haskell.org/package/blaze-builder
>
> Blaze looks a bit more specialized.

It has a larger surface area and more types, so it can be
intimidating, but it has the module 'Blaze.ByteString.Builder.Word'
which is an idealogical equivalent to the word primitives in
Data.Binary.Builder.

Antoine

> Many thanks,
> Aaron
>



More information about the Haskell-Cafe mailing list