[Haskell-cafe] Conditional compilation for different versions of GHC?

Michael Snoyman michael at snoyman.com
Sat Nov 27 20:48:45 CET 2010


On Sat, Nov 27, 2010 at 9:41 PM, Antoine Latter <aslatter at gmail.com> wrote:
> On Sat, Nov 27, 2010 at 10:59 AM, Jinjing Wang <nfjinjing at gmail.com> wrote:
>> Dear list,
>>
>> >From ghc 7.0.1 release notes:
>>
>>> The Language.Haskell.TH.Quote.QuasiQuoter type has two new fields: quoteType and quoteDec.
>>
>> Some of my code needs to be conditionally compiled to support both
>> version 6 and 7, what is the recommended way to do it?
>>
>> ref:
>>
>> * http://new-www.haskell.org/ghc/docs/7.0.1/html/users_guide/release-7-0-1.html
>
> Can you just not set those fields? Then the code should work as-is for
> both versions. You'll get warnings for GHC 7, I think.

Sorry Jinjing, I didn't read your original email carefully enough.
Antoine is absolutely correct, this is the better way to deal with
defining a quasiquoter. My suggestion is only necessary if you want to
*use* a quasiquoter.

Michael


More information about the Haskell-Cafe mailing list