FFI proposal: allow some control over the scope of C header files

Manuel M T Chakravarty chak at cse.unsw.edu.au
Sat Apr 29 19:36:21 EDT 2006


Duncan Coutts:
> On Mon, 2006-04-24 at 14:44 +0100, Simon Marlow wrote:
> > How about just adding a couple of new pragmas:
> > 
> >  {-# INCLUDE_PRIVATE "foo/bar.h" #-}
> >  {-# INCLUDE_PACKAGE "foo/bar.h" #-}
[..]
> So yes, I'd be satisfied with a GHC-only solution but I brought it up
> here just in case anyone else thinks that this issue of header scope
> might be worth specifying more clearly in the Haskell' FFI. Specifically
> if it'd make sense to standardise GHC & JHC's INCLUDE_* pragma(s) into
> proper FFI syntax (especially since most people seem to use that rather
> than the official syntax).

Let me summarise a bit:

      * Whether the whole issue is a problem or not is implementation
        specific - ie, if a compiler add prototypes into package files
        and doesn't propagate #includes, we are good; similarly, a NCG
        doesn't care.
      * NOINCLUDE is not the right solution for the above reason.

This leaves me with the opinion that we should really leave this as
pragma and not make it into FFI syntax.  It's a hint to some
implementations and irrelevant to others.

Do you agree?

Manuel




More information about the Haskell-prime mailing list