HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesemver-0.4.0.1Haskell2010

Data.SemVer.Constraint

An implementation of the Semantic Versioning Constraints. In absence of a standard around constraints, the behavior of node-semver is closely followed. The behavior is outlined here: https://github.com/npm/node-semver#ranges

  • 1 type
  • 2 values
  • Packagesemver-0.4.0.1
  • Exports3
  • LanguageHaskell2010
  • LicenceMPL-2.0
  • SourceConstraint.hs
valuesatisfies :: Version -> Constraint -> Bool
#

Checks whether the Version satisfies the Constraint

Note: Semantics of this are strange in the presence of pre-release identifiers. Without a proper standard for how constraint satisfaction should behave, this implementation attempts to follow the behavior of node-semver which can be found here: https://github.com/npm/node-semver#prerelease-tags.

This choice was made because node-semver is the most widely deployed implementation of semantic versioning with the best documentation around how to treat pre-release identifiers.

The summary is that you must opt into using pre-release identifiers by specifying them in the constraint and they must match the exact version that attempts to use a pre-release identifier.