Suppose you use the stack build tool to create a Haskell library (import packages from Hackage, etc.) that will be used with a C / C ++ project, in which main is in C / C ++ .
Suppose your project is named Lib.hs (which uses external libraries from hacking), is there a way to use the stack to export your Lib.o , Lib.hi and Lib_stub.h , which will be used by the C / C ++ compiler like gcc or g++ ?
EDIT: A related question might be: "how can I use Stack as a build tool to be used with a Haskell and C / C ++ project, in which main is in C / C ++
EDIT2:. When reflecting, one way to solve this problem would be to use Stack as usual, but port your core C / C ++ function to Haskell. Is this the best way to do this? Are there huge costs to doing this or anything I should know about?
haskell ffi haskell-stack
George
source share