version tags

Isaac Potoczny-Jones ijones at syntaxpolice.org
Thu May 8 19:54:26 EDT 2008


Duncan Coutts wrote:
> On Thu, 2008-05-08 at 15:39 -0700, Isaac Potoczny-Jones wrote:
>> Duncan Coutts wrote:
>> (snip)
>>> Does this seem like a good idea? What is/was the rationale for tags in
>>> the first place?
>> Yes, if I recall, Tags were not originally supposed to affect the 
>> ordering of versions,
> 
> And actually they don't affect the ordering but they do affect equality.
> Yes it's inconsistent.
> 
> If we look in the base library in Data.Version we find:
> 
> instance Eq Version where
>   v1 == v2  =  versionBranch v1 == versionBranch v2 
>                 && sort (versionTags v1) == sort (versionTags v2)
>                 -- tags may be in any order
> 
> instance Ord Version where
>   v1 `compare` v2 = versionBranch v1 `compare` versionBranch v2
> 
> This is clearly wrong. We would expect that:
>      a == b
> <=>  compare a b == EQ
> but that does not hold here.

Ewwwwwwwwwww.

>> but meant only for human consumption.  Whether 
>> changing that now is a good idea or not, it's hard to say.  How many 
>> packages in Hackage have any tags, for instance?
> 
> One. It was uploaded the other day which is why I just noticed that it's
> a problem.

Sounds like it's a good time to fix it now.  I'm surprised that only one 
package uses tags, though.  Maybe add something to the package lint 
during upload too?

peace,

   isaac



More information about the cabal-devel mailing list