[cabal] Extract simple static information from PackageDescription

Jakob Schöttl jschoett at gmail.com
Fri Nov 6 19:38:16 UTC 2015


Hello,

I have a simple question regarding GenericPackageDescription/ 
PackageDescription. I don't understand it from the docs: 
https://hackage.haskell.org/package/Cabal-1.22.4.0/docs/Distribution-PackageDescription.html
Google and IRC #haskell also didn't help me.

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.)

I tried it like this: https://gist.github.com/schoettl/b321baa5002ca48a46c5

But here the PackageDescription has no information (library == Nothing, 
executables == []).

I appreciate any help so much. And I will release the program as an 
open-source example so that it may help other people in future.

Thank you,

Jakob

-- 
Jakob Schöttl
E-Mail: jschoett at gmail.com
PGP-Key: 0x25055C7F
http://jakob.keramik-schoettl.de





More information about the Libraries mailing list