c2hs - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Vincent L

I'd like to try c2hs. I'm looking at the doc here : https://github.com/haskell/c2hs where they say it's possible to install it via cabal. However how can I run executable from cabal ? I'm used to use cabal to download and build dependencies, but I never ran tool with it.

c2hs is a pre-processor for Haskell FFI bindings to C libraries - haskell/c2hs
Torsten Schmits

cabal will automatically run c2hs for files with the extension .chs, you just have to add c2hs to the build-tool-depends

Vincent L

but what is chs file ?

Torsten Schmits

it's what c2hs consumes!

Vincent L

yes but what is it supposed to contain ? I suspect it's not a C header

Torsten Schmits

it's all explained here:

https://github.com/haskell/c2hs/wiki/Implementation-of-Haskell-Binding-Modules

c2hs is a pre-processor for Haskell FFI bindings to C libraries - haskell/c2hs
Vincent L

was looking at the "usage of c2hs" page

Torsten Schmits

the doc is pretty hard to read in general imo

Torsten Schmits

just ask here if you don't get something

Torsten Schmits

it definitely helps to know how CFFI works in general