[Haskell-cafe] Suggestions for #defines with FFI

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Jul 27 16:52:41 EDT 2005


On Wed, Jul 27, 2005 at 01:28:38PM -0500, John Goerzen wrote:
> I'm writing a Haskell interface to a library that #defines about 100
> constants corresponding to numeric exit codes.  It also defines hundreds
> of contants, over the same numbering ranges, for other purposes.  The
> exit codes are non-contiguous as well.
> 
> So my question is: is there a nice way I can represent this in Haskell,
> preferably without having to key in all 100 constants?

Did you consider hsc2hs?

Best regards
Tomasz


More information about the Haskell-Cafe mailing list