RFC: Extended version-range descriptions for Cabal

Bryan O'Sullivan bos at serpentine.com
Mon Sep 24 16:06:43 EDT 2007


Thomas Schilling wrote:

> (1) Wildcards:
> 
>   1.*   ~~>   >= 1 && < 2
> 
> in general
> 
>   m.n.o.*   ~~>    >= m.n.o && < m.n.(o+1) 

I like this.

> (2) Ranges:
> 
>   1 - 2.1   ~~>    >= 1 && <= 2.1
> 
> in general
> 
>   m - n   ~~>   >= m && <= n
> 
> If the upper limit is supposed to be exclusive, this can be combined
> with (1):
> 
>   1 - 2.0.*  ~~>  >= 1 && < 2.1

I like this, too, though maybe "to" instead of "-" would be a more 
readable token to use.

> A possible alternatve syntax (subsuming both (1) and (2)) could be:
> 
>   [1, 2.1]   ~~>   >= 1 && <= 2.1 
>   [1, 2.1)   ~~>   >= 1 && < 2.1  

This is too prone to fencepost errors due to the ease of getting the 
parens wrong.  Also, interval notation isn't widely enough used that 
people will readily remember which kind of paren means what.

	<b


More information about the Libraries mailing list