Re: [Haskell-cafe] Conditional compilation for different versionsof GHC?

2010-12-01 Thread Michael Snoyman
On Wed, Dec 1, 2010 at 6:58 PM, Claus Reinke  wrote:
>> This is obviously a personal preference issue, but I try to avoid the
>> Cabal macros since they don't let my code run outside the context of
>> Cabal. I often times like to have a test suite that I can just use
>> with runhaskell, and (unless you can tell me otherwise) I can't run it
>> anymore.
>>
>> Also, I think
>>
>> #if GHC7
>> ...
>> #endif
>>
>> is more transparent than a check on template-haskell.
>
> Just in case this hasn't been mentioned yet: if you want to be
> independent of cabal, there is the old standby
>
> __GLASGOW_HASKELL__
> http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#c-pre-processor

Well, I think this is the official right approach. I was not aware of
that, thank you Claus.

Michael

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Conditional compilation for different versionsof GHC?

2010-12-01 Thread Claus Reinke

This is obviously a personal preference issue, but I try to avoid the
Cabal macros since they don't let my code run outside the context of
Cabal. I often times like to have a test suite that I can just use
with runhaskell, and (unless you can tell me otherwise) I can't run it
anymore.

Also, I think

#if GHC7
...
#endif

is more transparent than a check on template-haskell.


Just in case this hasn't been mentioned yet: if you want to be
independent of cabal, there is the old standby

__GLASGOW_HASKELL__
http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#c-pre-processor

Claus



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe