[cabal] Extract simple static information from PackageDescription

Henning Thielemann lemming at henning-thielemann.de
Fri Nov 6 20:04:14 UTC 2015


On Fri, 6 Nov 2015, Jakob Schöttl wrote:

> I am trying to extract a simple static information out of the cabal 
> file: the hs-source-dirs
>
> Is there a way to get this without resolving conditionals, or with 
> minimal effort? (I don't even understand how to resolving conditionals.)

If you write in a package description:

   If flag(foo)
     Hs-Source-Dirs: foo
   Else
     Hs-Source-Dirs: bar

then Hs-Source-Dirs depends on conditionals. I use this technique in order 
to select specific modules for Unix and Windows without CPP. How do you 
want to extract Hs-Source-Dirs without knowing the flag values?


More information about the Libraries mailing list