Dealing with version ranges union and intersection.
Displayable representation of a range, for debug purposes
Set containing exactly one version.
exact v == intersection (higherThan v) (lowerThan <| bumpPatch v)
Set of all versions higher or equal to some version.
Set of versions comprised between two given versions.
The lower bound is included and the higher bound excluded.
v1 <= v < v2.
between v1 v2 == intersection (higherThan v1) (lowerThan v2)
Compute intersection of two sets of versions.
A range corresponds to any set of versions representable as a concatenation, union, and complement of version ranges building blocks.
Those building blocks are:
none: the empty setany: the set of all possible versionsexact v: the singleton set of only versionvhigherThan v: the set of versions higher or equal tovlowerThan v: the set of versions strictly lower thanvbetween v1 v2: the set of versions higher or equal tov1and strictly lower thanv2Internally, they are represented as an ordered list of intervals to have a normalized form enabling comparisons of ranges.