fficxx
fficxx copied to clipboard
std::function type cast
Now that we support std::function
, it is desirable to support casting function parameters from Haskell FFI types to C++ types.
Note that Haskell-C++ type/class correspondence is not 1-1 or 1-N, N-1. it's M-N.
For example,
For Function (Ptr RawA -> Ptr RawB -> IO (Ptr RawC))
, the corresponding C++ type can be
std::function<(C*)(A*,B*)>
, std::function<C(A*,B*)>
, std::function<C(A&,B&)>
and so on.