Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Version
- mkVersion :: [Int] -> Version
- mkVersion' :: Version -> Version
- versionNumbers :: Version -> [Int]
- nullVersion :: Version
- alterVersion :: ([Int] -> [Int]) -> Version -> Version
- version0 :: Version
- showVersion :: Version -> String
- validVersion :: Version -> Bool
Package versions
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
mkVersion :: [Int] -> Version Source #
Construct Version
from list of version number components.
For instance, mkVersion [3,2,1]
constructs a Version
representing the version 3.2.1
.
All version components must be non-negative. mkVersion []
currently represents the special null version; see also nullVersion
.
Since: Cabal-2.0.0.2
mkVersion' :: Version -> Version Source #
Variant of Version
which converts a Data.Version Version
into Cabal's Version
type.
Since: Cabal-2.0.0.2
versionNumbers :: Version -> [Int] Source #
nullVersion :: Version Source #
Constant representing the special null Version
The nullVersion
compares (via Ord
) as less than every proper
Version
value.
Since: Cabal-2.0.0.2
alterVersion :: ([Int] -> [Int]) -> Version -> Version Source #
Apply function to list of version number components
alterVersion f == mkVersion . f . versionNumbers
Since: Cabal-2.0.0.2
Backwards compatibility
showVersion :: Version -> String Source #
Deprecated: Use prettyShow. This function will be removed in Cabal-3.0 (estimated Oct 2018)
Internal
validVersion :: Version -> Bool Source #