Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stack.Types.Version
Description
Versions for packages.
Synopsis
- data Version
- data VersionRange
- newtype IntersectingVersionRange = IntersectingVersionRange {}
- data VersionCheck
- versionRangeText :: VersionRange -> Text
- withinRange :: Version -> VersionRange -> Bool
- intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
- toMajorVersion :: Version -> Version
- latestApplicableVersion :: VersionRange -> Set Version -> Maybe Version
- checkVersion :: VersionCheck -> Version -> Version -> Bool
- nextMajorVersion :: Version -> Version
- minorVersion :: Version -> Version
- stackVersion :: Version
- stackMinorVersion :: Version
Documentation
A Version
represents the version of a software entity.
Instances of Eq
and Ord
are provided, which gives exact
equality and lexicographic ordering of the version number
components (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.).
This type is opaque and distinct from the Version
type in
Data.Version since Cabal-2.0
. The difference extends to the
Binary
instance using a different (and more compact) encoding.
Since: Cabal-2.0.0.2
Instances
data VersionRange #
Instances
newtype IntersectingVersionRange Source #
Constructors
IntersectingVersionRange | |
Fields |
Instances
Show IntersectingVersionRange Source # | |
Defined in Stack.Types.Version Methods showsPrec :: Int -> IntersectingVersionRange -> ShowS # show :: IntersectingVersionRange -> String # showList :: [IntersectingVersionRange] -> ShowS # | |
Semigroup IntersectingVersionRange Source # | |
Defined in Stack.Types.Version | |
Monoid IntersectingVersionRange Source # | |
Defined in Stack.Types.Version |
data VersionCheck Source #
Constructors
MatchMinor | |
MatchExact | |
NewerMinor |
Instances
Eq VersionCheck Source # | |
Defined in Stack.Types.Version | |
Ord VersionCheck Source # | |
Defined in Stack.Types.Version Methods compare :: VersionCheck -> VersionCheck -> Ordering # (<) :: VersionCheck -> VersionCheck -> Bool # (<=) :: VersionCheck -> VersionCheck -> Bool # (>) :: VersionCheck -> VersionCheck -> Bool # (>=) :: VersionCheck -> VersionCheck -> Bool # max :: VersionCheck -> VersionCheck -> VersionCheck # min :: VersionCheck -> VersionCheck -> VersionCheck # | |
Show VersionCheck Source # | |
Defined in Stack.Types.Version Methods showsPrec :: Int -> VersionCheck -> ShowS # show :: VersionCheck -> String # showList :: [VersionCheck] -> ShowS # | |
ToJSON VersionCheck Source # | |
Defined in Stack.Types.Version Methods toJSON :: VersionCheck -> Value # toEncoding :: VersionCheck -> Encoding # toJSONList :: [VersionCheck] -> Value # toEncodingList :: [VersionCheck] -> Encoding # | |
FromJSON VersionCheck Source # | |
Defined in Stack.Types.Version |
versionRangeText :: VersionRange -> Text Source #
Display a version range
withinRange :: Version -> VersionRange -> Bool #
Does this version fall within the given range?
This is the evaluation function for the VersionRange
type.
intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange Source #
A modified intersection which also simplifies, for better display.
toMajorVersion :: Version -> Version Source #
Returns the first two components, defaulting to 0 if not present
latestApplicableVersion :: VersionRange -> Set Version -> Maybe Version Source #
Given a version range and a set of versions, find the latest version from the set that is within the range.
checkVersion :: VersionCheck -> Version -> Version -> Bool Source #
nextMajorVersion :: Version -> Version Source #
Get the next major version number for the given version
minorVersion :: Version -> Version Source #
Get minor version (excludes any patchlevel)
stackVersion :: Version Source #
Current Stack version
stackMinorVersion :: Version Source #
Current Stack minor version (excludes patchlevel)