scope of header files

Ian Lynagh igloo at
Wed Mar 5 21:39:35 EST 2008

On Thu, Mar 06, 2008 at 02:18:08AM +0000, Duncan Coutts wrote:
> foreign import ccall unsafe "curses.h & ACS_UARROW"
>   acs_uarrow :: Ptr ChType
> #define ACS_UARROW      NCURSES_ACS('-') /* arrow pointing up */

You ought to use a C wrapper around these sorts of things. If you're
lucky, the API docs will tell you which values and functions might be
macros, e.g.
is clear about what is (or might be) what.

I can't remember if it's been discussed before, but I think it might be
a good idea for the FFI to be able to create these C stubs itself, if
you give a certain keyword - or perhaps even by default as it's the
safe thing to do, at the expense of performance.


More information about the Glasgow-haskell-users mailing list