hs-bindgen is a Haskell library that automatically generates Haskell FFI
bindings from C header files.
Warning
This project has not had an official release yet. There is a wide variety of C (and C preprocessor) code in the world, so we are currently soliciting feedback prior to the first official release. Please try it out! If something breaks, please check the issues to see if the problem is already known, and open an issue if not.
Check the releases (RSS) for release information. A Hackage package will be made available from the first official release.
- Second pre-release of
hs-bindgenby Edsko de Vries (27 March 2026) hs-bindgen 0.1-alpharelease by Edsko de Vries (10 February 2026)- Wait, this isn't Haskell... by Curtis Chin Jen Sem (26 December 2025)
- Automatic C Bindings Generation for Haskell (9 October 2025)
We test hs-bindgen with various C projects, and we include some examples in
this repository. Please note that these are used for testing and are not
meant to be complete. See the examples README for details.
Examples include:
- Botan, a C++ cryptography library: bindings
- libpcap, an interface to various kernel packet capture mechanisms: bindings
- MiniSat, a minimalistic, open-source SAT solver: bindings
- QR-Code-generator, a library for generating QR codes: bindings
- RogueUtil, a cross-platform C library for terminal manipulation: bindings
- rpm, a powerful package management system: bindings
Our thanks go to those who have contributed to this project with development, bug reports, feature requests, blog posts, etc., including: