Skip to content

Commit

Permalink
Note how to do "not equal" with constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Oct 30, 2023
1 parent 054108f commit 46321d8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions doc/cabal-package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1477,8 +1477,20 @@ 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::

To avoid package versions when there is no `not equal` operator, use
``<`` and ``>`` in combination with the ``||`` operator. We might want to
do this to avoid a deprecated version or to skip versions. 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:

::

Expand Down

0 comments on commit 46321d8

Please sign in to comment.