Skip to content

Extend TH with addModCStub

inline-c could benefit of the ability to tell the compiler to include some code in the object file of the current module. https://github.com/fpco/inline-c/issues/21

This way, a module FFI.hs using inline-c doesn't need to produce a file FFI.c with C code, but the code can be built and included in the object file of the module.

For this sake, it would be needed the following TH function:

addModCStub :: String -> Q ()

which would indicate to the compiler that the C code in the given string needs to be built and included in the object file of the current module.

Edited by Facundo Domínguez
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information