Commit 2e092600 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add notThisVersion :: Version -> VersionRange

Opposite of ThisVersion, it means /= x.y but is actually implemented
as > x.y || < x.y as we do not have not or not equal as primitives.
parent 0bf79ca3
......@@ -45,7 +45,7 @@ module Distribution.Version (
Version(..),
-- * Version ranges
VersionRange(..),
VersionRange(..), notThisVersion,
orLaterVersion, orEarlierVersion,
betweenVersionsInclusive,
withinRange,
......@@ -81,6 +81,9 @@ isAnyVersion :: VersionRange -> Bool
isAnyVersion AnyVersion = True
isAnyVersion _ = False
notThisVersion :: Version -> VersionRange
notThisVersion v = UnionVersionRanges (EarlierVersion v) (LaterVersion v)
orLaterVersion :: Version -> VersionRange
orLaterVersion v = UnionVersionRanges (ThisVersion v) (LaterVersion v)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment