cplusplus-th allows you to foreign import C++ functions that are
compatible with the ccall calling convention. It also includes
some standard library abstractions.
[Index]
For package maintainers and hackage trustees
cplusplus-th allows you to foreign import C++ functions that are
compatible with the ccall calling convention. It also includes
some standard library abstractions.
With the following C++ function in the object file cbits/string.o:
We can import it into Haskell with:
It works by looking up the symbol in the object file.
When using cabal, it is recommended you include the C++ file in
your c-sources and compile it in a build hook. For example:
Foreign.CPlusPlusStdLib exports the following type class:
To avoid orphan instances, it implements instances for
some numeric types, String and ByteString.