stack-1.3.2: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Types.Version

Description

Versions for packages.

Synopsis

- data Version
- data VersionRange :: *
- newtype IntersectingVersionRange = IntersectingVersionRange {
  - getIntersectingVersionRange :: VersionRange
  }
- data VersionCheck
  - = MatchMinor
  - | MatchExact
  - | NewerMinor
- versionParser :: Parser Version
- parseVersion :: MonadThrow m => Text -> m Version
- parseVersionFromString :: MonadThrow m => String -> m Version
- versionString :: Version -> String
- versionText :: Version -> Text
- toCabalVersion :: Version -> Version
- fromCabalVersion :: Version -> Version
- mkVersion :: String -> Q Exp
- 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

# Documentation

data Version #

A package version.

Instances

Eq Version # |
Methods (==) :: Version -> Version -> Bool # (/=) :: Version -> Version -> Bool #
Data 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 # |
Methods compare :: Version -> Version -> Ordering # (<) :: Version -> Version -> Bool # (<=) :: Version -> Version -> Bool # (>) :: Version -> Version -> Bool # (>=) :: Version -> Version -> Bool # max :: Version -> Version -> Version # min :: Version -> Version -> Version #
Show Version # |
Methods showsPrec :: Int -> Version -> ShowS # show :: Version -> String # showList :: [Version] -> ShowS #
Generic Version # |
Associated Types type Rep Version :: * -> * # Methods from :: Version -> Rep Version x # to :: Rep Version x -> Version #
Lift Version # |
Methods lift :: Version -> Q Exp #
Hashable Version # |
Methods hashWithSalt :: Int -> Version -> Int # hash :: Version -> Int #
FromJSON Version # |
Methods parseJSON :: Value -> Parser Version # parseJSONList :: Value -> Parser [Version] #
FromJSONKey Version # |
Methods fromJSONKey :: FromJSONKeyFunction Version # fromJSONKeyList :: FromJSONKeyFunction [Version] #
ToJSON Version # |
Methods toJSON :: Version -> Value # toEncoding :: Version -> Encoding # toJSONList :: [Version] -> Value # toEncodingList :: [Version] -> Encoding #
NFData Version # |
Methods rnf :: Version -> () #
Store Version # |
Methods size :: Size Version # poke :: Version -> Poke () # peek :: Peek Version #
type Rep Version # |
type Rep Version = D1 (MetaData "Version" "Stack.Types.Version" "stack-1.3.2-BJTOe4yfRNq2cDDPL8b7LK" True) (C1 (MetaCons "Version" PrefixI True) (S1 (MetaSel (Just Symbol "unVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Word))))
type Ann Version # |
type Ann Version = AnsiAnn

data VersionRange :: * #

Instances

Eq VersionRange |
Methods (==) :: VersionRange -> VersionRange -> Bool # (/=) :: VersionRange -> VersionRange -> Bool #
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 |
Methods readsPrec :: Int -> ReadS VersionRange # readList :: ReadS [VersionRange] # readPrec :: ReadPrec VersionRange # readListPrec :: ReadPrec [VersionRange] #
Show VersionRange |
Methods showsPrec :: Int -> VersionRange -> ShowS # show :: VersionRange -> String # showList :: [VersionRange] -> ShowS #
Generic VersionRange |
Associated Types type Rep VersionRange :: * -> * # Methods from :: VersionRange -> Rep VersionRange x # to :: Rep VersionRange x -> VersionRange #
Binary VersionRange |
Methods put :: VersionRange -> Put # get :: Get VersionRange # putList :: [VersionRange] -> Put #
Text VersionRange |
Methods disp :: VersionRange -> Doc # parse :: ReadP r VersionRange #
type Rep VersionRange |
type Rep VersionRange = D1 (MetaData "VersionRange" "Distribution.Version" "Cabal-1.24.0.0" 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 "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))))))

newtype IntersectingVersionRange #

Constructors

IntersectingVersionRange |
Fields getIntersectingVersionRange :: VersionRange

Instances

Show IntersectingVersionRange # |
Methods showsPrec :: Int -> IntersectingVersionRange -> ShowS # show :: IntersectingVersionRange -> String # showList :: [IntersectingVersionRange] -> ShowS #
Monoid IntersectingVersionRange # |
Methods mempty :: IntersectingVersionRange # mappend :: IntersectingVersionRange -> IntersectingVersionRange -> IntersectingVersionRange # mconcat :: [IntersectingVersionRange] -> IntersectingVersionRange #

data VersionCheck #

Constructors

MatchMinor |
MatchExact |
NewerMinor |

Instances

Eq VersionCheck # |
Methods (==) :: VersionCheck -> VersionCheck -> Bool # (/=) :: VersionCheck -> VersionCheck -> Bool #
Ord VersionCheck # |
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 # |
Methods showsPrec :: Int -> VersionCheck -> ShowS # show :: VersionCheck -> String # showList :: [VersionCheck] -> ShowS #
FromJSON VersionCheck # |
Methods parseJSON :: Value -> Parser VersionCheck # parseJSONList :: Value -> Parser [VersionCheck] #
ToJSON VersionCheck # |
Methods toJSON :: VersionCheck -> Value # toEncoding :: VersionCheck -> Encoding # toJSONList :: [VersionCheck] -> Value # toEncodingList :: [VersionCheck] -> Encoding #

versionParser :: Parser Version #

Attoparsec parser for a package version.

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

Convenient way to parse a package version from a `Text`.

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

Migration function.

versionString :: Version -> String #

Get a string representation of a package version.

versionText :: Version -> Text #

Get a string representation of a package version.

toCabalVersion :: Version -> Version #

Convert to a Cabal version.

fromCabalVersion :: Version -> Version #

Convert from a Cabal version.

mkVersion :: String -> Q Exp #

Make a package version.

versionRangeText :: VersionRange -> Text #

Display a version range

withinRange :: Version -> VersionRange -> Bool #

Check if a version is within a version range.

intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange #

A modified intersection which also simplifies, for better display.

toMajorVersion :: Version -> Version #

Returns the first two components, defaulting to 0 if not present

latestApplicableVersion :: VersionRange -> Set Version -> Maybe Version #

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 #

nextMajorVersion :: Version -> Version #

Get the next major version number for the given version