Cabal-syntax-3.12.1.0: A library for working with .cabal files

Safe Haskell | None
Language | Haskell2010

Distribution.Types.PackageVersionConstraint

Synopsis

- data PackageVersionConstraint = PackageVersionConstraint PackageName VersionRange
- thisPackageVersionConstraint :: PackageIdentifier -> PackageVersionConstraint
- simplifyPackageVersionConstraint :: PackageVersionConstraint -> PackageVersionConstraint

# Documentation

data PackageVersionConstraint Source #

A version constraint on a package. Different from `ExeDependency` and `Dependency` since it does not specify the need for a component, not even the main library. There are a few places in the codebase where `Dependency` was used where `PackageVersionConstraint` is not used instead (#5570).

Constructors

PackageVersionConstraint PackageName VersionRange |

#### Instances

Instances details

Parsec PackageVersionConstraint Source #

    >>> simpleParsec "foo" :: Maybe PackageVersionConstraint
    Just (PackageVersionConstraint (PackageName "foo") (OrLaterVersion (mkVersion [0])))

    >>> simpleParsec "foo >=2.0" :: Maybe PackageVersionConstraint
    Just (PackageVersionConstraint (PackageName "foo") (OrLaterVersion (mkVersion [2,0])))

    >>> simpleParsec "foo-2.0" :: Maybe PackageVersionConstraint
    Just (PackageVersionConstraint (PackageName "foo") (ThisVersion (mkVersion [2,0])))

Instance details Defined in Distribution.Types.PackageVersionConstraint Methods parsec :: CabalParsing m => m PackageVersionConstraint Source #
Pretty PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods pretty :: PackageVersionConstraint -> Doc Source # prettyVersioned :: CabalSpecVersion -> PackageVersionConstraint -> Doc Source #
Structured PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods structure :: Proxy PackageVersionConstraint -> Structure Source # structureHash' :: Tagged PackageVersionConstraint MD5
Binary PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods put :: PackageVersionConstraint -> Put Source # get :: Get PackageVersionConstraint Source # putList :: [PackageVersionConstraint] -> Put Source #
NFData PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods rnf :: PackageVersionConstraint -> () Source #
Data PackageVersionConstraint Source # |

Instance details

Defined in Distribution.Types.PackageVersionConstraint

Methods

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

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

toConstr :: PackageVersionConstraint -> Constr #

dataTypeOf :: PackageVersionConstraint -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic PackageVersionConstraint Source # |

Instance details

Defined in Distribution.Types.PackageVersionConstraint

Associated Types

type Rep PackageVersionConstraint |

Instance details

Defined in Distribution.Types.PackageVersionConstraint

type Rep PackageVersionConstraint = D1 ('MetaData "PackageVersionConstraint" "Distribution.Types.PackageVersionConstraint" "Cabal-syntax-3.12.1.0-5c0e" 'False) (C1 ('MetaCons "PackageVersionConstraint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)))

Methods

from :: PackageVersionConstraint -> Rep PackageVersionConstraint x #

to :: Rep PackageVersionConstraint x -> PackageVersionConstraint #

Read PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods readsPrec :: Int -> ReadS PackageVersionConstraint # readList :: ReadS [PackageVersionConstraint] # readPrec :: ReadPrec PackageVersionConstraint # readListPrec :: ReadPrec [PackageVersionConstraint] #
Show PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods showsPrec :: Int -> PackageVersionConstraint -> ShowS # show :: PackageVersionConstraint -> String # showList :: [PackageVersionConstraint] -> ShowS #
Eq PackageVersionConstraint Source # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods (==) :: PackageVersionConstraint -> PackageVersionConstraint -> Bool # (/=) :: PackageVersionConstraint -> PackageVersionConstraint -> Bool #
type Rep PackageVersionConstraint Source # |

Instance details

Defined in Distribution.Types.PackageVersionConstraint

type Rep PackageVersionConstraint = D1 ('MetaData "PackageVersionConstraint" "Distribution.Types.PackageVersionConstraint" "Cabal-syntax-3.12.1.0-5c0e" 'False) (C1 ('MetaCons "PackageVersionConstraint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)))

thisPackageVersionConstraint :: PackageIdentifier -> PackageVersionConstraint Source #

Since: Cabal-syntax-3.4.0.0

simplifyPackageVersionConstraint :: PackageVersionConstraint -> PackageVersionConstraint Source #

Since: Cabal-syntax-3.4.0.0