How to find out the C type signature corresponding to a Haskell function type in FFI?

Brian Hulley brianh at metamilk.com
Tue Mar 7 21:16:24 EST 2006


Bulat Ziganshin wrote:
> Hello Brian,
>
> Tuesday, March 7, 2006, 7:35:27 PM, you wrote:
>
>> foreign import ccall duma_init :: Int -> IO Int
>
> int duma_init(int);
>> Also, I really wanted to be able to use () -> IO () but () doesn't
>> seem to be allowed in FFI...
>
> void f(void);
>
> foreign import ccall f :: IO ()

Thanks Bulat for these function prototypes (+ the links you posted). I'd 
thought that it would be complicated to deal with the IO monad but I see 
from these prototypes that it's not so complicated after all... :-)

Best regards,
Brian. 



More information about the Glasgow-haskell-users mailing list