
22 Jul
2008
22 Jul
'08
12:05 p.m.
On Tue, 2008-07-22 at 04:57 -0500, Spencer Janssen wrote:
I'm testing for ghc version. Could I somehow test for the base-library version instead? - Conal
Yes. Here is a snippet from binary.cabal:
flag applicative-in-base
library if flag(applicative-in-base) build-depends: base >= 2.0 cpp-options: -DAPPLICATIVE_IN_BASE else build-depends: base < 2.0
This is the sort of example where our Cabal syntactic sugar proposal helps a bit: library if package(base >= 2.0) cpp-options: -DAPPLICATIVE_IN_BASE So two lines rather than six and you don't need to understand the relational semantics so clearly to make sense of it. Now if only we'd get round to implementing it. Duncan