[Haskell-cafe] greencard and callbacks
Vincenzo aka Nick Name
vincenzo_mlRE.MOVE at yahoo.it
Thu May 6 14:36:15 EDT 2004
I realize that I myself might have already asked this question to some
of you, but I am really confused now. Can I have some opinion on "what
is the right way to implement callbacks from C to haskell"? Will I have
to learn the FFI and stop it, or is there some tool to automate the
process? I need to bind a single function which takes a record of
callbacks, and that's all.
Can greencard support callbacks? If yes, can someone provide a simple
example? I thought to do:
import Foreign.GreenCard
%#include<stdio.h>
%fun doit :: Int -> (Int -> Int) -> IO ()
%code printf("%d",arg2(arg1));
which does not work, as someone might already have expected :)
Thanks all
Vincenzo
More information about the Haskell-Cafe
mailing list