hs-bindgen
May 19, 2026 ยท View on GitHub
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.
Documentation
Blog posts
- Second pre-release of
hs-bindgenby Edsko de Vries (27 March 2026) hs-bindgen 0.1-alpharelease by Edsko de Vries (10 February 2026)
Community
- Wait, this isn't Haskell... by Curtis Chin Jen Sem (26 December 2025)
Papers
- Automatic C Bindings Generation for Haskell (9 October 2025)
Examples
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
Packages in this repository
c-expr-dsl, a library that provides a DSL for the language support byc-expr-runtimec-expr-runtime, a library that provides a Haskell DSL for simple C arithmetic expressionshs-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
Supporting packages
doxygen-parser, a parser for the XML files generated by the Doxygen CLIlibclang-bindings, a library that provides bindings for the LLVM/ClanglibclangC API
Contributors
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
- 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