Getting constants from #defines

Ian Lynagh igloo at
Tue Jun 25 22:14:13 EDT 2002

Hi all,

I was expecting something like

foreign import ccall unsafe "static ncurses.h ERR" cERR :: CInt

to allow me to access the value of ERR (a #define) as cERR. However, as
far as I can tell GHC is trying to compile this as if ERR was a
function. This seems silly to me as a function can always be defined
with a type "a -> b" where "a", "b" or both can be "()" so this should
be unambiguous.

Am I misunderstanding what is going on here?


More information about the FFI mailing list