<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-12-16 6:33 GMT+01:00 David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div dir="auto">The documentation for pokeByteOff indicates that the following equality holds:</div><div dir="auto"><br></div><div dir="auto">  pokeElemOff addr idx x =</div><div dir="auto">    poke (addr `plusPtr` (idx * sizeOf x)) x</div><div dir="auto"><br></div><div dir="auto">[...] Was this intentional?</div></div></blockquote><div><br></div><div>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. Doing anything else would be a) language-specific and b) platform-ABI-specific. Storable is just meant as a basic building block to do such more involved things.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div dir="auto"> If so, I believe sizeOf and alignment should document the law. [...]</div></div></blockquote><div><br></div><div>Perhaps, but what exactly do you feel is missing there?</div></div></div></div>