Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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.
Instances
newtype PrereleaseTags Source #
Instances
type BuildMetaData = [Text] Source #
A SemVer has major, minor and patch versions, and zero or more pre-release version tags.
SemVer | |
|
Instances
Eq SemVer Source # | |
Ord SemVer Source # | Define an Ord instance which ignores the buildMetaData. |
Show SemVer Source # | |
Generic SemVer Source # | |
Hashable SemVer Source # | |
Defined in Data.SemVer.Types | |
type Rep SemVer Source # | |
Defined in Data.SemVer.Types type Rep SemVer = D1 (MetaData "SemVer" "Data.SemVer.Types" "semver-range-0.2.8-EUE4datnY94FUOjpW514FG" False) (C1 (MetaCons "SemVer" PrefixI True) ((S1 (MetaSel (Just "svMajor") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "svMinor") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)) :*: (S1 (MetaSel (Just "svPatch") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: (S1 (MetaSel (Just "svTags") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 PrereleaseTags) :*: S1 (MetaSel (Just "svBuildMetadata") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 BuildMetaData))))) |
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 |
Instances
Eq SemVerRange Source # | |
Defined in Data.SemVer.Types (==) :: SemVerRange -> SemVerRange -> Bool # (/=) :: SemVerRange -> SemVerRange -> Bool # | |
Ord SemVerRange Source # | |
Defined in Data.SemVer.Types compare :: SemVerRange -> SemVerRange -> Ordering # (<) :: SemVerRange -> SemVerRange -> Bool # (<=) :: SemVerRange -> SemVerRange -> Bool # (>) :: SemVerRange -> SemVerRange -> Bool # (>=) :: SemVerRange -> SemVerRange -> Bool # max :: SemVerRange -> SemVerRange -> SemVerRange # min :: SemVerRange -> SemVerRange -> SemVerRange # | |
Show SemVerRange Source # | |
Defined in Data.SemVer.Types showsPrec :: Int -> SemVerRange -> ShowS # show :: SemVerRange -> String # showList :: [SemVerRange] -> ShowS # |
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.