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
- LibYAML, a YAML parser and emitter library: 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
- Chromium Embedded Framework (CEF), a framework for embedding Chromium-based browsers in other applications: bindings
hs-bindgen, a utility that automatically generates Haskell bindings from C headershs-bindgen-runtime, a library that provides runtime support for code generated byhs-bindgenhs-bindgen-test-runtime, a library for testing bindings generated byhs-bindgen
c-expr-dslandc-expr-runtime, a DSL for C macro semanticsdoxygen-parser, a parser for the XML files generated by the Doxygen CLIlibclang-bindings, a library that provides bindings for the LLVM/ClanglibclangC API
Our thanks go to those who have contributed to hs-bindgen and supporting
packages with development, bug reports, feature requests, blog posts, etc.,
including:
- Alex Mason
andromeda-fp- Armando Santos
aveltras- Chandler Barlow
- Curtis Chin Jen Sem
- Dominik Schrempf
- Duncan Coutts
- Edsko de Vries
- Finley McIlwaine
- George Thomas
- Jeremy Nuttall
- Jonathan Lorimer
- Joris Dral
- Justin Le
Krantz98- Lin Jian
- Matthias Heinzel
Merivuokko- Oleg Grenrus
- Phil de Joux
- Rodrigo Mesquita
- Ruifeng Xie
- Sam Derbyshire
- Shea Levy
- Tobias Dammers
- Travis Cardwell
- Travis Whitaker