well-typed / hs-bindgen

Automatically generate Haskell bindings from C header files
23 stars 0 forks source link

Generalize to multiple C libraries #294

Open edsko opened 1 week ago

edsko commented 1 week ago

(This could be considered an instance of #75.)

Suppose we are generating bindings for multiple C libraries, and those libraries have inter-dependencies; perhaps library A exports some types that are used by library B. Then we should be able to generate bindings for library B in such a way that the bindings for A and B can be used together.

phadej commented 5 days ago

I guess this is a generalization of having "stdlib prelude + header" to "stdlib prelude + some libraries + header". We'd need a way to configure that some (intermediate) types are from some 3rd party module.

Then we can process various "libraries" separately.

As I said in #75, trying to process into multiple modules would not work, not with Cabal-like 1-to-1 preprocessor support, not really with TH either.