John Goerzen | 27 Jul 20:28
Favicon
Gravatar

Suggestions for #defines with FFI

Hi,

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?  Or will I just
have to list all the options and give up type checking to differentiate
one purpose of a constant from another?

Thanks,

-- John

Gmane