Open edsko opened 1 month ago
For Cabal preprocessors it's a bad idea. The whole system works as one input file to one module (hsc2hs, alex and happy work so). That said, Cabal preprocessor setup is just awful (cannot configure new ones declaratively AFAIK), so I'd use literate haskell hack (i.e. use -pgmL
flag for GHC), but that is even more strongly one to one mapping.
As a starting point, we will simply generate a single Haskell module from a single C header. It seems that for Rust
bindgen
this suffices: the standard workflow for multiple headers involves creating awrapper.h
. Nonetheless, we might want to generalize to multiple C headers, and (for the preprocessor only #9 , not for TH mode #11) multiple Haskell modules.