state of the cabal (preprocessors)

Malcolm Wallace Malcolm.Wallace at
Mon Oct 25 11:35:22 EDT 2004

"Simon Marlow" <simonmar at> writes:

> Are the link options from each module stored in the .hi file and
> collected together at link time?  GHC doesn't have anything like that.

Sadly, no.  The link options are recovered from the sources by
'hmake' during ordinary re-compilation dependency analysis, and
simply accumulated.  (Or at least, that was the plan.  It works if
you give all the modules in one command-line to nhc98, but I'm not
sure if I ever implemented it in hmake.)

> Link-time options have a place in the package-wide Cabal description,
> too.  

I'm thinking Cabal (or at least the concept of 'package') is probably
the best place for extra link dependencies, not the source code
(which may not even exist, if the packages are binary).

> For the compile-time options, how about
>   {-# OPTIONS_{GHC,NHC98,HUGS} ... #-}

I'd be happy enough with that.  On the plus side, it is a more
regular scheme than currently, and is easily extended to new compilers
(should they come along).  On the negative, it is an un-forced change,
and might break lots of code (although only in a rather trivial way).

> and we should probably have a compiler-independent way to specify
> extensions.  Hmm, wasn't there a proposal for {-# LANGUAGE #-} at one time?

I agree this might be nice.  Didn't Cabal have some kind of enumeration
of language extensions at one time?


More information about the Libraries mailing list