Edit: Sorry, I misunderstood the question and thought you asked for it with hsc2hs, but not without. Incorrect alignment can lead to incorrect data and cause crashes (think if you are building an array of structures), so you really should use something portable.
According to the FFI cookbook, you can define
#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)
which is then used as
instance Storable Struct where alignment _ =
The alignment
keyword should be available in ghc> 7.2.1, so you wonβt need to define it yourself with the very new ghc.
John l
source share