.so dynamic library of a haskell program and calling it from C
- Export a haskell function with
- Create a C wrapper that calls
hs_initwhen the library is loaded.
- Compile the
ghc, linking with
- Use it from C by linking as usual.
(For more details, see here.)