hs-bindgen

May 19, 2026 ยท View on GitHub

License: BSD-3-Clause Build Status Nightly CI: Examples Nightly CI: Check links

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

Community

Papers

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:

Packages in this repository

  • c-expr-dsl, a library that provides a DSL for the language support by c-expr-runtime
  • c-expr-runtime, a library that provides a Haskell DSL for simple C arithmetic expressions
  • hs-bindgen, a utility that automatically generates Haskell bindings from C headers
  • hs-bindgen-runtime, a library that provides runtime support for code generated by hs-bindgen
  • hs-bindgen-test-runtime, a library for testing bindings generated by hs-bindgen

Supporting packages

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: