Haskell integration with .Net?

I was wondering if there is good documentation for integrating Haskell with the outside world (in particular .NET). I would like to be able to call Haskell functions from my .NET code. I saw that there was a previously asked question that showed how to pass strings back and forth, but I was wondering if there were more general links and the possibility of going through a more complex type.

+3
haskell interop
source share
2 answers

You should probably read the material in this other question , because it really provides links to related materials. But in any case, the bullet point version:

  • You can invoke unmanaged native code from .NET using P / Invoke . See End of Wikipedia article for tutorials and documentation for this part.

  • You can export Haskell functions through Haskell FFI . Make sure you export functions using the correct calling convention (stdcall, not ccall). See Also GHC FFI Documentation .

So basically you want to export your Haskell functions, as if you used them with C, create a DLL with the necessary functions, then use P / Invoke to call the Haskell functions. And definitely reread the accepted answer to another question, it mentions a few mistakes that you need to avoid.

+3
source share
+3
source share

All Articles