
On Thu, 2008-05-08 at 16:54 -0700, Isaac Potoczny-Jones wrote:
Duncan Coutts wrote:
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.
Yeah quite :-)
Sounds like it's a good time to fix it now. I'm surprised that only one package uses tags, though.
It's clear we should drop the check on the tags from the == test but I'm not sure if we should also change the showVersion or parseVersion functions. I'm planning on changing the equivalent of showVersion in Cabal to not display the tags.
Maybe add something to the package lint during upload too?
I've attached a patch to do that and I'm cc'ing Ross so he can decide if he agrees or not. Duncan