A Version represents the version of a software entity.
An instance Eq is provided, which implements exact equality modulo
reordering of the tags in the versionTags field.
The interpretation of ordering is dependent on the entity being
versioned, and perhaps the application. For example, simple branch
ordering is probably sufficient for many uses (see the versionBranch
field), but some versioning schemes may include pre-releases which
have tags pre1, pre2, and so on, and these would need to be
taken into account when determining ordering. In some cases, date
ordering may be more appropriate, so the application would have to
look for date tags in the versionTags field and compare those.
Similarly, concrete representations of versions may differ, so we leave
parsing and printing up to the application.
|versionBranch :: [Int]|
The numeric branch for this version. This reflects the
fact that most software versions are tree-structured; there
is a main trunk which is tagged with versions at various
points (1,2,3...), and the first branch off the trunk after
version 3 is 3.1, the second branch off the trunk after
version 3 is 3.2, and so on. The tree can be branched
arbitrarily, just by adding more digits.
We represent the branch as a list of Int, so
version 3.2.1 becomes [3,2,1]. Lexicographic ordering
(i.e. the default instance of Ord for [Int]) gives
the natural ordering of branches.
|versionTags :: [String]||A version can be tagged with an arbitrary list of strings.
The interpretation of the list of tags is entirely dependent
on the entity that this version applies to.|