Cabal-2.4.0.1: A framework for packaging Haskell software

Safe HaskellNone
LanguageHaskell2010

Distribution.Types.Version

Contents

Synopsis

Package versions

data Version Source #

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
Eq Version Source # 
Instance details

Defined in Distribution.Types.Version

Methods

(==) :: Version -> Version -> Bool #

(/=) :: Version -> Version -> Bool #

Data Version Source # 
Instance details

Defined in Distribution.Types.Version

Methods

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 #

toConstr :: Version -> Constr #

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 :: (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 #

Ord Version Source # 
Instance details

Defined in Distribution.Types.Version

Read Version Source # 
Instance details

Defined in Distribution.Types.Version

Show Version Source # 
Instance details

Defined in Distribution.Types.Version

Generic Version Source # 
Instance details

Defined in Distribution.Types.Version

Associated Types

type Rep Version :: * -> * #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Binary Version Source # 
Instance details

Defined in Distribution.Types.Version

Methods

put :: Version -> Put #

get :: Get Version #

putList :: [Version] -> Put #

NFData Version Source # 
Instance details

Defined in Distribution.Types.Version

Methods

rnf :: Version -> () #

Pretty Version Source # 
Instance details

Defined in Distribution.Types.Version

Methods

pretty :: Version -> Doc Source #

Parsec Version Source # 
Instance details

Defined in Distribution.Types.Version

Text Version Source # 
Instance details

Defined in Distribution.Types.Version

Newtype SpecVersion (Either Version VersionRange) Source # 
Instance details

Defined in Distribution.Parsec.Newtypes

type Rep Version Source # 
Instance details

Defined in Distribution.Types.Version

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 mkVersion which converts a Data.Version Version into Cabal's Version type.

Since: Cabal-2.0.0.2

versionNumbers :: Version -> [Int] Source #

Unpack Version into list of version number components.

This is the inverse to mkVersion, so the following holds:

(versionNumbers . mkVersion) vs == vs

Since: Cabal-2.0.0.2

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

version0 :: Version Source #

Version 0. A lower bound of Version.

Since: Cabal-2.2

Backwards compatibility

showVersion :: Version -> String Source #

Deprecated: Use prettyShow. This function will be removed in Cabal-3.0 (estimated Oct 2018)

Internal