scope of header files

Ross Paterson ross at
Wed Mar 5 18:46:42 EST 2008

On Wed, Mar 05, 2008 at 11:16:14PM +0000, Duncan Coutts wrote:
> I was under the impression that with ghc, ffi import declarations like
> this do not escape the module:
> foreign import ccall unsafe "foo.h foo" foo :: IO ()

GHC can inline the stub across module (and thus package) boundaries,
so the #include can escape.

> It's hard to tell what header files need to be used globally and
> inherited by client packages and which can safely be used privately.

No, it's easy: they're all potentially inherited.

More information about the Glasgow-haskell-users mailing list