
18 Aug
2016
18 Aug
'16
11:17 a.m.
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?