Ticket #232 (closed enhancement: fixed)
implement extended syntax for package version ranges
|Reported by:||duncan||Owned by:||nominolo|
Revised proposal: http://www.haskell.org/pipermail/cabal-devel/2008-January/001786.html
In order to make it easy for package package authors to describe correct and robust dependencies we (Duncan Coutts and I) propose the following syntactical extension to version range specifications in package files.
~ 1.2.* ~~> >= 1.2 && < 1.3
~ x.y.* ~~> >= x.y && < x.(y+1)
The "~" operator should be read as "in the range of". Another option would have been "-", but this is used to specify exact versions in other parts of the Cabal infrastructure , e.g., "cabal install xmonad-0.5".
This is the most common specification of package dependencies. The assumption is that changes in the last version number indicate only backwards compatible changes, as is suggested in the new package versioning policy . The use of "*" matches the common usage as a wildcard character.
~ 1.2.1+ ~~> >= 1.2.1 && < 1.3
~ x.y.z+ ~~> >= x.y.z && < x.(y+1)
The idea here is that sometimes packages need a certain patch level or, as in Cabal's case, a stable release and possible further bugfixes. In those cases the wildcard notation is too liberal, however the explicit range description would be too noisy (and possibly error prone). (Also, using "+" instead of "*" serves as better visual distinction.)