The Haskell FFI report says that imports and exports of dynamic functions always have those types:

foreign import ccall "dynamic"
  mkFun :: FunPtr fun -> fun

foreign import ccall "wrapper"
  mkCallback :: fun -> IO (FunPtr fun)

where 'fun' is an IO function. Since 'fn' can be a considerably large type expression I usually define

type Importer fun = FunPtr fun -> fun
type Exporter fun = fun -> IO (FunPtr fun)


How about adding these type synonyms to Foreign?
_______________________________________________
FFI mailing list
FFI@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ffi

Reply via email to