fficxx icon indicating copy to clipboard operation
fficxx copied to clipboard

std::function type cast

Open wavewave opened this issue 6 years ago • 0 comments

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.

wavewave avatar Sep 09 '18 06:09 wavewave