need help with ffi function pointers

David Sankel camio at yahoo.com
Sun Mar 2 14:42:34 EST 2003


--- Wolfgang Thaller <wolfgang.thaller at gmx.net> wrote:
> 
> foreign import ccall "wrapper" mkCallback :: IO ()
> -> FunPtr (IO ())
> foreign import ccall "f_setCallback" f_setCallback
> :: FunPtr (IO ()) -> 
> IO ()
> 
> setCallback cb = mkCallback cb >>= f_setCallback

Thanks for the help.  Is there a ghc bug with wrappers
like this?  Compiling that code gives me:

    Unacceptable result type in foreign declaration:
FunPtr (IO ())
    When checking declaration:
        foreign import ccall safe "wrapper" mkCallback
:: IO ()
                                                      
   -> FunPtr (IO ())


Thanks,

David J. Sankel



More information about the FFI mailing list