Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data PrereleaseTag
- newtype PrereleaseTags = PrereleaseTags [PrereleaseTag]
- type BuildMetaData = [Text]
- data SemVer = SemVer {
- svMajor :: !Int
- svMinor :: !Int
- svPatch :: !Int
- svTags :: !PrereleaseTags
- svBuildMetadata :: !BuildMetaData
- data SemVerRange
- = Eq SemVer
- | Gt SemVer
- | Lt SemVer
- | Geq SemVer
- | Leq SemVer
- | And SemVerRange SemVerRange
- | Or SemVerRange SemVerRange
- versionsOf :: SemVerRange -> [SemVer]
- stripRangeTags :: SemVerRange -> SemVerRange
- semver :: Int -> Int -> Int -> SemVer
- semver' :: Int -> Int -> Int -> PrereleaseTags -> SemVer
- semver'' :: Int -> Int -> Int -> PrereleaseTags -> BuildMetaData -> SemVer
- toTuple :: SemVer -> (Int, Int, Int)
- tuplesOf :: SemVerRange -> [(Int, Int, Int)]
- rangePrereleaseTags :: SemVerRange -> PrereleaseTags
- sharedTags :: SemVerRange -> Maybe PrereleaseTags
- anyVersion :: SemVerRange
- renderSV :: SemVer -> Text
- matches :: SemVerRange -> SemVer -> Bool
- matchesSimple :: SemVerRange -> SemVer -> Bool
- matchesTags :: SemVerRange -> PrereleaseTags -> PrereleaseTags -> Bool
- bestMatch :: SemVerRange -> [SemVer] -> Either String SemVer
- parseSemVer :: Text -> Either ParseError SemVer
- parseSemVerRange :: Text -> Either ParseError SemVerRange
- pSemVerRange :: Parser SemVerRange
- pSemVer :: Parser SemVer
- fromHaskellVersion :: Version -> Either Text SemVer
- matchText :: Text -> Text -> Either Text Bool
- splitWS :: Text -> [Text]
Documentation
data PrereleaseTag Source #
Prerelease tags can either be numbers or text.
newtype PrereleaseTags Source #
type BuildMetaData = [Text] Source #
A SemVer has major, minor and patch versions, and zero or more pre-release version tags.
SemVer | |
|
data SemVerRange Source #
A range specifies bounds on a semver.
Eq SemVer infixl 4 | Exact equality |
Gt SemVer infixl 4 | Greater than |
Lt SemVer infixl 4 | Less than |
Geq SemVer infixl 4 | Greater than or equal to |
Leq SemVer infixl 4 | Less than or equal to |
And SemVerRange SemVerRange infixl 3 | Conjunction |
Or SemVerRange SemVerRange infixl 3 | Disjunction |
versionsOf :: SemVerRange -> [SemVer] Source #
Pull all of the concrete versions out of a range.
stripRangeTags :: SemVerRange -> SemVerRange Source #
Strip out all prerelease tags from a given SemVerRange
.
semver'' :: Int -> Int -> Int -> PrereleaseTags -> BuildMetaData -> SemVer Source #
Create a SemVer with tags and metadata.
rangePrereleaseTags :: SemVerRange -> PrereleaseTags Source #
Get all of the prerelease tags from a version range.
sharedTags :: SemVerRange -> Maybe PrereleaseTags Source #
Get the range prerelease tags if they're all the same; otherwise Nothing.
anyVersion :: SemVerRange Source #
Satisfies any version.
matches :: SemVerRange -> SemVer -> Bool infixl 2 Source #
Returns whether a given semantic version matches a range. Note that there are special cases when there are prerelease tags. For details see https://github.com/npm/node-semver#prerelease-tags.
matchesSimple :: SemVerRange -> SemVer -> Bool Source #
Simple predicate calculus matching, doing AND and OR combination with numerical comparison.
matchesTags :: SemVerRange -> PrereleaseTags -> PrereleaseTags -> Bool Source #
Given a range and two sets of tags, the first being a bound on the second, uses the range to compare the tags and see if they match.
bestMatch :: SemVerRange -> [SemVer] -> Either String SemVer Source #
Gets the highest-matching semver in a range.
parseSemVer :: Text -> Either ParseError SemVer Source #
Parse a string as an explicit version, or return an error.
parseSemVerRange :: Text -> Either ParseError SemVerRange Source #
Parse a string as a version range, or return an error.
pSemVerRange :: Parser SemVerRange Source #
Top-level parser. Parses a semantic version range.
fromHaskellVersion :: Version -> Either Text SemVer Source #
Parse a semver from a haskell version. There must be exactly three numbers in the versionBranch field.