Storable laws
Henning Thielemann
lemming at henning-thielemann.de
Sat Dec 16 14:16:29 UTC 2017
On Sat, 16 Dec 2017, Sven Panne wrote:
> 2017-12-16 6:33 GMT+01:00 David Feuer <david.feuer at gmail.com>:
> The documentation for pokeByteOff indicates that the following equality holds:
>
> pokeElemOff addr idx x =
> poke (addr `plusPtr` (idx * sizeOf x)) x
>
> [...] Was this intentional?
>
>
> Yep, that was intentional, think of pokeElemOff as indexing into an
> array. Note that the FFI intentionally does not specify how to
> (un)marshal structs, only basic types and arrays of them.
I thought that arrays require alignment of their elements.
More information about the Libraries
mailing list