I would like to use an external library, RDFox, in a Haskell project.
Context: I am working on Windows and Linux, both 64 bits, using GHC 7.10 and stack. RDFox is programmed in C++. RDFox shared libraries (.dll, .so) can be downloaded with Java and Python wrappers.
Aim: I would like to reuse the compiled libraries from RDFox (.dll, .so) in my project in Haskell, so I need to create a Haskell wrapper for RDFox.
Issues: Being relatively new to Haskell, I have difficulty to know where to start. I found several pages about the subject (from the Haskell wiki and StackOverflow), but the workflow and configuration are not clear to me.
Questions: I would like to know:
- How to configure stack and cabal to use external library, to build on Windows or Linux (different machines, same repository).
- How to configure GHCi for interactive testing on this external library.
- Is the translation of the Python wrapper to Haskell the best way to go? I would like to avoid the analysis of the RDFox C++ code.
System.Win32.DLL
from theWin32
package andSystem.Posix.DynamicLinker
from theunix
package. However, the name-mangling will probably differ between the two platforms, so you have to do the work twice. If you write a C wrapper, you only have to do it once. – Tobias Brandtextern "C"
is already in place (one would have a hard time creating the Python wrapper without it). – n. 1.8e9-where's-my-share m.