[Haskell-cafe] buildDepends syntax and checks

Shakthi Kannan shakthimaan at gmail.com
Wed Jan 4 11:29:29 CET 2012


Hi,

#1 I would like to know if there is any context grammar or syntax for
the package dependencies that are allowed in buildDepends in each
.cabal file? AnyVersion and WildcardVersion are consistent. But, I see
quite a bit of variations in what is included in UnionVersionRange and
IntersectVersionRange.

For example:

* Two WildcardVersions in a UnionVersionRange (fixed-point 0.5.0.1) [1]

* UnionVersionRange and WildcardVersion in a IntersectVersionRange
(hlint 1.6.12) [2]

#2 Is there a way to cross-check if the defined dependencies are in
fact correct, or is it left to the package owner to write them?

#3 Some dependencies have an 'or' for the same package (bytestring
0.9) [3], like "base (<3) or array, base (≥3)", and the cabal file
says:

  library
    if flag(split-base)
      build-depends:     base >= 3, array
    else
      build-depends:     base < 3

I use the a script [4] to convert the .cabal files to .json, then the
.json lists both the build-depends!

Appreciate any inputs in this regard!

Thanks!

SK

[1] fixed-point 0.5.0.1 (see base).
http://hackage.haskell.org/packages/archive/fixed-point/0.5.0.1/fixed-point.cabal

[2] hlint 1.6.12 (see uniplate).
http://hackage.haskell.org/packages/archive/hlint/1.6.12/hlint.cabal

[3] bytestring 0.9. http://hackage.haskell.org/package/bytestring-0.9

[4] Cabal2json.hs. http://shakthimaan.fedorapeople.org/SOURCES/Cabal2json.hs

-- 
Shakthi Kannan
http://www.shakthimaan.com



More information about the Haskell-Cafe mailing list