How does one use pass by reference functions using the ffi?

David Sankel camio at
Sat Jan 24 22:30:20 EST 2004

Hello FFI experts,

  Say I have a function somewhere in c land with the following declaration:

void doStuff( int &a, int &b);

  What would the appropriate Haskell wrapper for this function look like? 
I'm looking to construct a haskell function of the type: 

doStuff :: Int -> Int -> IO( (Int,Int) )

  There weren't any relevant results when searching `"pass by reference"
haskell ffi` in google.

Thanks in advance,

David J. Sankel

More information about the FFI mailing list