From b38822303371f5daa411211c18a16190fb8bfa57 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Mon, 30 Oct 2023 09:51:33 -0400 Subject: [PATCH] Note how to do "not equal" with constraints --- doc/cabal-package.rst | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/cabal-package.rst b/doc/cabal-package.rst index 75ec9ff40ed..2995c41bdfb 100644 --- a/doc/cabal-package.rst +++ b/doc/cabal-package.rst @@ -1477,8 +1477,22 @@ system-dependent values for these fields. Version constraints use the operators ``==, >=, >, <, <=`` and a version number. Multiple constraints can be combined using ``&&`` or - ``||``. If no version constraint is specified, any version is - assumed to be acceptable. For example: + ``||``. + + .. Note:: + + Even though there is no ``/=`` operator, by combining operators we can + skip over one or more versions, to skip a deprecated version or to skip + versions that upset the constraint solving. + + For example, the ``time =1.12.*`` series depends on ``base >=4.13 && <5`` + but ``time-1.12.3`` bumps the lower bound on base to ``>=4.14``. If we + still want to compile with a ``ghc-8.8.*`` version of GHC that ships with + ``base-4.13`` then we can use ``time >=1.12 && (time <1.12.3 || time + >1.12.3)``. + + If no version constraint is specified, any version is assumed to be + acceptable. For example: ::