A complementary representation of a VersionRange, using an increasing sequence of separated (i.e., non-overlapping, non-touching) non-empty intervals. The represented range is the union of these intervals, meaning that the empty sequence denotes the empty range.
As ranges form a Boolean algebra, we can compute union, intersection, and complement. These operations are all linear in the size of the input, thanks to the ordered representation.
The interval-sequence representation gives a canonical representation for the semantics of VersionRanges. This makes it easier to check things like whether a version range is empty, covers all versions, or requires a certain minimum or maximum version. It also makes it easy to check equality (just ==) or containment. It also makes it easier to identify 'simple' version predicates for translation into foreign packaging systems that do not support complex version range expressions.
Instances2Eq, Show
Eq VersionIntervalsDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyShow VersionIntervalsDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.Legacy