Pragmas for FFI imports

Simon Marlow simonmar at microsoft.com
Tue Feb 21 11:50:20 EST 2006


First of all, my position on this has always been (since we argued about
this during the design of the FFI) that include files and libraries
should be kept out of the source file and specified separately, since
they are a part of the build infrastructure, and vary across platforms.

I lost the argument for include files, but this is why libraries cannot
currently be specified inside source files.  Back in the FFI discussion,
we didn't have Cabal, but now that we do, Cabal is the natural place to
specify these things.

On 21 February 2006 14:13, Einar Karttunen wrote:

> But it is not possible to have e.g.
> Foo.Bar.MySQL (depends on -lmysql)
> Foo.Bar.PgSQL (depends on -lpq)
> 
> and with suitable optional compiler support create an executable
> that depends only on those libraries that it actually uses. This
> is not possible if library dependencies are per-package. Of course
> compilers can still default to actually handling dependencies
> on a per package level if they want without breaking anything.

I don't understand this - surely if you just put those two modules in
separate packages, then everything works?  Or is it that you don't want
to do that?

Cheers,
	Simon


More information about the Haskell-prime mailing list