I thought I wanted something very simple but just cannot find out how to do it;
I assume I am overlooking something very obvious.

I want to hand over a tuple to a C function and get a tuple back:

  type myTup = (Bool, Int)
  myFun :: myTup -> myTup

So myFun should be implemented as a C function and I thought I use a struct to 
represent the tuple:

  typedef struct myStruct { int b; int x; };
  struct myStruct myCFun (struct myStruct);

I tried to use c2hs, looked at the documentation of ffi, c2hs, greenCard, hsc2h
the mail archives etc. but I somehow I cannot figure out how to do it.
Do I have to use Ptr? Do I have to make myTup an instance of Storable? Or?

I greatly appreciate any hint!
-- Axel

Phone: +46 8 790 4124, Email: [EMAIL PROTECTED], Web: www.it.kth.se/~axel
FFI mailing list

Reply via email to