jberryman
jberryman

Reputation: 16645

Conditional compilation based on GHC point release

I need to work around a bug present in (I think) GHC (7.8.0 - 7.8.2). I don't think I can use __GLASGOW_HASKELL__ since we only get major and minor version numbers, and I don't think I can use the base library version (although I can't find a list associating ghc releases -> base versions).

In other words I need to do:

#if GHC < 7.8.3
    this code
#else
    this code
#endif

Upvotes: 1

Views: 297

Answers (1)

jberryman
jberryman

Reputation: 16645

I somehow missed this in the docs, but this is easily done with impl()

library foo
    ...
    if impl(ghc >= 7.8.3)
       cpp-options: -DTRYREADMVAR

Upvotes: 1

Related Questions