[Haskell-cafe] carry "state" around ....

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sat Jul 19 11:05:23 EDT 2008

On Sat, 2008-07-19 at 10:45 -0400, Brandon S. Allbery KF8NH wrote:
> On 2008 Jul 19, at 2:40, Galchin, Vasili wrote:
> > My viewpoint is that the above "Internal members" must be "carried"
> > around in a Haskell program. Am I correct?? If I am correct, then
> > the Linux implementation of Posix AIO is not portable to say
> > Solaris? In hindsight, if I am correct, it seems that 
> You are correct --- but Solaris also has its own addenda, and its
> standard fields are not at the same offsets as in the Linux aiocb.
>  The only safe way to do this is to use an opaque aiocb on the Haskell
> side and accessors in C via FFI.

You can do field accessors using an FFI pre-processor like c2hs or
hsc2hs which will calculate the correct field offsets for the current
platform. No need for C wrappers.


More information about the Haskell-Cafe mailing list