state of the cabal (preprocessors)

Simon Marlow simonmar at
Mon Oct 25 09:24:15 EDT 2004

On 25 October 2004 13:57, Malcolm Wallace wrote:

> "Simon Marlow" <simonmar at> writes:
>>> [Aside: Is there a general agreement that the OPTION pragma should
>>> be understood by all Haskell systems, whereas system-specific
>>> options are given by pragmas like OPTIONS-GHC, OPTIONS-NHC, etc.
>>> or something along those lines?]
>> I'm happy to switch to using {-# OPTIONS_GHC #-} (or something) if
>> there's consensus.  Consider that a vote in favour on behalf of the
>> GHC camp.
> Currently I believe ghc uses
>     {-# OPTIONS ... #-}
> whilst nhc98 uses the pair
>     {-# OPTIONS_COMPILE ... #-}
>     {-# OPTIONS_LINK ... #-}
> and Hugs has
>     #!runhugs ...
> I have no specific preferences for naming, and am happy to change to
> whatever consensus arrives.  However I do think separating out extra
> link options from the compile-time options could be useful.

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.
Link-time options have a place in the package-wide Cabal description,

Options in a source module are good for options which apply to this
particular module and no other, whereas link options are more global.
I'm not sure that I'd put link options in the source files even if I

For the compile-time options, how about

  {-# OPTIONS_{GHC,NHC98,HUGS} ... #-}

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


More information about the Libraries mailing list