From 726dcfdf9ad31eeeb37c4ceb470ddbbe291c8731 Mon Sep 17 00:00:00 2001 From: Duncan Coutts <duncan@haskell.org> Date: Thu, 29 May 2008 09:22:44 +0000 Subject: [PATCH] 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. --- Distribution/Version.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Distribution/Version.hs b/Distribution/Version.hs index b37d3ce56c..7d319e4f3f 100644 --- a/Distribution/Version.hs +++ b/Distribution/Version.hs @@ -45,7 +45,7 @@ module Distribution.Version ( Version(..), -- * Version ranges - VersionRange(..), + VersionRange(..), notThisVersion, orLaterVersion, orEarlierVersion, betweenVersionsInclusive, withinRange, @@ -84,6 +84,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) -- GitLab