1 module Distribution
.Solver
.Modular
.Version
14 import Distribution
.Solver
.Compat
.Prelude
17 import qualified Distribution
.Version
as CV
-- from Cabal
18 import Distribution
.Pretty
(prettyShow
)
20 -- | Preliminary type for versions.
23 -- | String representation of a version.
24 showVer
:: Ver
-> String
27 -- | Version range. Consists of a lower and upper bound.
28 type VR
= CV
.VersionRange
30 -- | String representation of a version range.
31 showVR
:: VR
-> String
34 -- | Unconstrained version range.
38 -- | Version range fixing a single version.
42 -- | Intersect two version ranges.
43 (.&&.) :: VR
-> VR
-> VR
44 v1
.&&. v2
= simplifyVR
$ CV
.intersectVersionRanges v1 v2
46 -- | Union of two version ranges.
47 (.||
.) :: VR
-> VR
-> VR
48 v1
.||
. v2
= simplifyVR
$ CV
.unionVersionRanges v1 v2
50 -- | Simplify a version range.
51 simplifyVR
:: VR
-> VR
52 simplifyVR
= CV
.simplifyVersionRange
54 -- | Checking a version against a version range.
55 checkVR
:: VR
-> Ver
-> Bool
56 checkVR
= flip CV
.withinRange