stack-1.6.1: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Types.Version

Description

Versions for packages.

Synopsis

Documentation

data Version Source #

A package version.

Instances

Eq Version Source # 

Methods

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

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

Data Version Source # 

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 # 
Show Version Source # 
Generic Version Source # 

Associated Types

type Rep Version :: * -> * #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Lift Version Source # 

Methods

lift :: Version -> Q Exp #

NFData Version Source # 

Methods

rnf :: Version -> () #

Hashable Version Source # 

Methods

hashWithSalt :: Int -> Version -> Int #

hash :: Version -> Int #

FromJSON Version Source # 
FromJSONKey Version Source # 
ToJSON Version Source # 
Store Version Source # 
type Rep Version Source # 
type Rep Version = D1 (MetaData "Version" "Stack.Types.Version" "stack-1.6.1-IqvhEU9bVMJDq7KbzjhlTg" True) (C1 (MetaCons "Version" PrefixI True) (S1 (MetaSel (Just Symbol "unVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Word))))
type Ann Version Source # 

data VersionRange :: * #

Instances

Eq VersionRange 
Data VersionRange 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VersionRange -> c VersionRange #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VersionRange #

toConstr :: VersionRange -> Constr #

dataTypeOf :: VersionRange -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c VersionRange) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VersionRange) #

gmapT :: (forall b. Data b => b -> b) -> VersionRange -> VersionRange #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VersionRange -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VersionRange -> r #

gmapQ :: (forall d. Data d => d -> u) -> VersionRange -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> VersionRange -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> VersionRange -> m VersionRange #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VersionRange -> m VersionRange #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VersionRange -> m VersionRange #

Read VersionRange 
Show VersionRange 
Generic VersionRange 

Associated Types

type Rep VersionRange :: * -> * #

Text VersionRange 
NFData VersionRange 

Methods

rnf :: VersionRange -> () #

Binary VersionRange 
type Rep VersionRange 
type Rep VersionRange = D1 (MetaData "VersionRange" "Distribution.Version" "Cabal-2.0.1.1-61z5REOTsUmCPJSNCcIic9" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "AnyVersion" PrefixI False) U1) (C1 (MetaCons "ThisVersion" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)))) ((:+:) (C1 (MetaCons "LaterVersion" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version))) (C1 (MetaCons "EarlierVersion" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version))))) ((:+:) ((:+:) (C1 (MetaCons "WildcardVersion" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version))) (C1 (MetaCons "MajorBoundVersion" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version)))) ((:+:) (C1 (MetaCons "UnionVersionRanges" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 VersionRange)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 VersionRange)))) ((:+:) (C1 (MetaCons "IntersectVersionRanges" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 VersionRange)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 VersionRange)))) (C1 (MetaCons "VersionRangeParens" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 VersionRange)))))))

versionParser :: Parser Version Source #

Attoparsec parser for a package version.

parseVersion :: MonadThrow m => Text -> m Version Source #

Convenient way to parse a package version from a Text.

parseVersionFromString :: MonadThrow m => String -> m Version Source #

Migration function.

versionString :: Version -> String Source #

Get a string representation of a package version.

versionText :: Version -> Text Source #

Get a string representation of a package version.

toCabalVersion :: Version -> Version Source #

Convert to a Cabal version.

fromCabalVersion :: Version -> Version Source #

Convert from a Cabal version.

mkVersion :: String -> Q Exp Source #

Make a package version.

versionRangeText :: VersionRange -> Text Source #

Display a version range

withinRange :: Version -> VersionRange -> Bool Source #

Check if a version is within a version range.

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.

nextMajorVersion :: Version -> Version Source #

Get the next major version number for the given version

data UpgradeTo Source #

A Package upgrade; Latest or a specific version.

Constructors

Specific Version 
Latest