@hackage / hsc2hs

A preprocessor that helps with writing Haskell bindings to C code

Latest0.68.10

About

Metadata

  • Last updated , by AndreasAbel
  • License BSD-3-Clause
  • Categories Development
  • Maintained by: ghc-devs@haskell.org

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.10.3
  3. 9.8.4
  4. 9.6.7
  5. 9.4.8
  6. 9.2.8
  7. 9.0.2
  8. 8.10.7
  9. 8.8.4
  10. 8.6.5
  11. 8.4.4
  12. 8.2.2
  13. 8.0.2

Package Flags

Use the -f option with cabal commands to enable flags

    in-ghc-tree (off by default)

    Are we in a GHC tree?

Readme

The hsc2hs program can be used to automate some parts of the process of writing Haskell bindings to C code. It reads an almost-Haskell source file with embedded special constructs, and outputs a real Haskell file with these constructs processed, based on information taken from some C headers. The extra constructs provide Haskell counterparts of C types, values of C constants, including sizes of C types, and access to fields of C structs.

For more details, see the hsc2hs section in the GHC User's Guide.