[Haskell-cafe] How to set a GHC option for a single module and a specific version of GHC?

Duncan Coutts duncan.coutts at googlemail.com
Mon Jun 7 16:53:28 EDT 2010


On 5 June 2010 09:28, Bernie Pope <florbitous at gmail.com> wrote:
> Hi,
>
> I'm looking for a way to set a GHC compile option on a specific module
> (not every module in the program) but only for a specific version of
> GHC. Ideally within the confines of cabal, and in a portable way.
>
> GHC provides the OPTIONS_GHC pragma, but it does not appear to provide
> a way for the pragma to fire for specific versions of GHC. Also, I
> can't use an #ifdef trick because "File-header pragmas are read once
> only, before pre-processing the file (e.g. with cpp)."

Not that it helps you immediately, but this is now fixed:

http://hackage.haskell.org/trac/ghc/ticket/3457

I'm not sure which release will include the fix.

Duncan


More information about the Haskell-Cafe mailing list