Advice sought for 6.9 and Arrow/Category

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Jul 22 08:05:19 EDT 2008


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



More information about the Glasgow-haskell-users mailing list