Liwen Huang wrote: > Oops. My "long" is indeed Int32 :(. Thank you for pointing that out. To avoid surprises like this, have a look at: http://haskell.org/ghc/docs/latest/html/base/Foreign.C.Types.html On the other hand, when you really want to fix the sizes of the integral types, use e.g. Int32 on the Haskell side and int32_t on the C side. Cheers, S.