How much does it cost for Haskell FFI to go into C and back?
The answer depends mostly on whether the foreign call is a safe or an unsafe call. An unsafe C call is basically just a function call, so if there’s no (nontrivial) type conversion, there are three function calls if you make three foreign calls, and between one and four when you write a wrapper in … Read more