https://github.com/well-typed/hs-bindgen is a nifty new tool that can automate the process of writing Haskell bindings for C headers. Seeing as botan-bindings consists of mostly foreign import declarations, type definitions and utility pattern synonyms -- things that hs-bindgen generates automatically -- we can probably just generate most of the code for botan-bindings using hs-bindgen
Downside:
- Reliance on an external tool introduces a point of failure
hs-bindgen is customisable in some parts, but not everywhere, so some fiddling with CPP will still be needed
Benefits:
- Easy to create new bindings when a new version of the C++ library is released
- The generated code has a consistent approach and style
- Reduced maintenance cost
https://github.com/well-typed/hs-bindgen is a nifty new tool that can automate the process of writing Haskell bindings for C headers. Seeing as
botan-bindingsconsists of mostlyforeign importdeclarations, type definitions and utility pattern synonyms -- things thaths-bindgengenerates automatically -- we can probably just generate most of the code forbotan-bindingsusinghs-bindgenDownside:
hs-bindgenis customisable in some parts, but not everywhere, so some fiddling with CPP will still be neededBenefits: