[Hackage] #232: implement extended syntax for package version ranges

Hackage trac at galois.com
Mon Feb 4 20:20:33 EST 2008


#232: implement extended syntax for package version ranges
----------------------------+-----------------------------------------------
  Reporter:  duncan         |        Owner:  nominolo
      Type:  enhancement    |       Status:  new     
  Priority:  normal         |    Milestone:          
 Component:  Cabal library  |      Version:  1.2.3.0 
  Severity:  normal         |     Keywords:          
Difficulty:  normal         |   Ghcversion:  6.8.2   
  Platform:                 |  
----------------------------+-----------------------------------------------
 Revised proposal: http://www.haskell.org/pipermail/cabal-
 devel/2008-January/001786.html

 Reproduced here:

 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.

 == Wildcards ==

 {{{
   ~ 1.2.*  ~~>  >= 1.2 && < 1.3
 }}}

 in general

 {{{
   ~ 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 [1].  The use of "*" matches the common usage as a
 wildcard character.

 == Upward Ranges ==

 {{{
  ~ 1.2.1+  ~~>  >= 1.2.1 && < 1.3
 }}}

 in general

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

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/232>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects


More information about the cabal-devel mailing list