Proposal: remove versionTags from Data.Version

Thomas Miedema thomasmiedema at gmail.com
Tue Sep 23 21:57:47 UTC 2014


Version in Data.Version from base is defined as:

    data Version = Version { versionBranch :: [Int], versionTags ::
[String] }

    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


## Proposal
Remove the `versionTags` field from this type.


## Motivation
* The Eq and Ord instances of Version don't agree whether two versions
with different
versionTags are equal or not [1]:

    > a = Version [1] ["a"]
    > b = Version [1] ["b"]
    > compare a b
    EQ
    > a == b
    False

* The Package versioning policy does not include version tags [2].
* Cabal no longer supports package version tags [3,4].

Discussion period: 2 weeks.

Note: this is not a proposal to ignore trailing zeros when comparing
versions. Neither is this is a proposal to change the Eq instance for
Version to only consider the versionBranch field. This is a proposal to
remove versionTags altogether.

[1] https://ghc.haskell.org/trac/ghc/ticket/2496
[2] http://www.haskell.org/haskellwiki/Package_versioning_policy
[3] https://github.com/haskell/cabal/issues/890
[4]
http://www.haskell.org/cabal/users-guide/developing-packages.html#package-names-and-versions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140923/79ae98b5/attachment.html>


More information about the Libraries mailing list