semver-0.4.0.1: Representation, manipulation, and de/serialisation of Semantic Versions.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.SemVer.Constraint

Description

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

Synopsis

Documentation

satisfies :: Version -> Constraint -> Bool Source #

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.

fromText :: Text -> Either String Constraint Source #

Parsing function to create a Constraint from Text according to the rules specified here: https://github.com/npm/node-semver#ranges

Advanced syntax is not yet supported.