Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Version
- mkVersion :: [Int] -> Version
- mkVersion' :: Version -> Version
- versionNumbers :: Version -> [Int]
- nullVersion :: Version
- alterVersion :: ([Int] -> [Int]) -> Version -> Version
- version0 :: Version
- validVersion :: Version -> Bool
- versionDigitParser :: CabalParsing m => m Int
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: 2.0.0.2
Instances
Parsec Version Source # | |
Defined in Distribution.Types.Version parsec :: CabalParsing m => m Version Source # | |
Pretty Version Source # | |
Defined in Distribution.Types.Version pretty :: Version -> Doc Source # prettyVersioned :: CabalSpecVersion -> Version -> Doc Source # | |
Structured Version Source # | |
Defined in Distribution.Types.Version | |
Data Version Source # | |
Defined in Distribution.Types.Version gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version dataTypeOf :: Version -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) gmapT :: (forall b. Data b => b -> b) -> Version -> Version gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version | |
Generic Version Source # | |
Read Version Source # | |
Show Version Source # | |
Binary Version Source # | |
NFData Version Source # | |
Defined in Distribution.Types.Version | |
Eq Version Source # | |
Ord Version Source # | |
type Rep Version Source # | |
Defined in Distribution.Types.Version type Rep Version = D1 ('MetaData "Version" "Distribution.Types.Version" "Cabal-syntax-3.13.0.0-inplace" 'False) (C1 ('MetaCons "PV0" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "PV1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int]))) |
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: 2.0.0.2
mkVersion' :: Version -> Version Source #
Variant of mkVersion
which converts a Data.Version
Version
into Cabal's Version
type.
Since: 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: 2.0.0.2
alterVersion :: ([Int] -> [Int]) -> Version -> Version Source #
Apply function to list of version number components
alterVersion f == mkVersion . f . versionNumbers
Since: 2.0.0.2
Internal
validVersion :: Version -> Bool Source #
versionDigitParser :: CabalParsing m => m Int Source #
An integral without leading zeroes.
Since: 3.0