ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Version.Semver

Description

The semver grammar and ordering (npm). SemverKey wraps the versions library's SemVer, so precedence is the library's: semver 11 ordering, with +build metadata excluded from it. parseSemver scans the grammar itself. Within the length and digit-run bounds it accepts and builds what the library's parser does. Among prerelease identifiers numeric ones rank below alphanumeric ones, the opposite of the rule in Ecluse.Core.Version.Token.

Synopsis

Documentation

newtype SemverKey Source #

A parsed semver version, ordered by the versions library's semver 11 precedence.

Constructors

SemverKey SemVer 

parseSemver :: Text -> Maybe SemverKey Source #

Parse a semver version, or Nothing so an ordering rule abstains rather than drops it. The digit-run bound keeps each number within the key's fixed-width components.

renderSemver :: SemverKey -> Text Source #

Render every semver field, including build metadata excluded from precedence.

isSemverStable :: SemverKey -> Bool Source #

Whether a semver version is stable: a final release with no prerelease component.