cabal-install-solver-3.8.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellNone
LanguageHaskell2010

Distribution.Solver.Types.PackageConstraint

Description

Per-package constraints. Package constraints must be respected by the solver. Multiple constraints for each package can be given, though obviously it is possible to construct conflicting constraints (eg impossible version range or inconsistent flag assignment).

Synopsis

Documentation

data ConstraintScope Source #

Determines to what packages and in what contexts a constraint applies.

Constructors

ScopeTarget PackageName

A scope that applies when the given package is used as a build target. In other words, the scope applies iff a goal has a top-level qualifier and its namespace matches the given package name. A namespace is considered to match a package name when it is either the default namespace (for --no-independent-goals) or it is an independent namespace with the given package name (for --independent-goals).

ScopeQualified Qualifier PackageName

The package with the specified name and qualifier.

ScopeAnySetupQualifier PackageName

The package with the specified name when it has a setup qualifier.

ScopeAnyQualifier PackageName

The package with the specified name regardless of qualifier.

scopeToplevel :: PackageName -> ConstraintScope Source #

Constructor for a common use case: the constraint applies to the package with the specified name when that package is a top-level dependency in the default namespace.

scopeToPackageName :: ConstraintScope -> PackageName Source #

Returns the package name associated with a constraint scope.

data PackageProperty Source #

A package property is a logical predicate on packages.

Instances

Instances details
Eq PackageProperty Source # 
Instance details

Defined in Distribution.Solver.Types.PackageConstraint

Show PackageProperty Source # 
Instance details

Defined in Distribution.Solver.Types.PackageConstraint

Generic PackageProperty Source # 
Instance details

Defined in Distribution.Solver.Types.PackageConstraint

Associated Types

type Rep PackageProperty :: Type -> Type #

Binary PackageProperty Source # 
Instance details

Defined in Distribution.Solver.Types.PackageConstraint

Structured PackageProperty Source # 
Instance details

Defined in Distribution.Solver.Types.PackageConstraint

type Rep PackageProperty Source # 
Instance details

Defined in Distribution.Solver.Types.PackageConstraint

type Rep PackageProperty = D1 ('MetaData "PackageProperty" "Distribution.Solver.Types.PackageConstraint" "cabal-install-solver-3.8.1.0-DQHDRT4McfjEkCZkJP5jZc" 'False) ((C1 ('MetaCons "PackagePropertyVersion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)) :+: C1 ('MetaCons "PackagePropertyInstalled" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PackagePropertySource" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PackagePropertyFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FlagAssignment)) :+: C1 ('MetaCons "PackagePropertyStanzas" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [OptionalStanza])))))

dispPackageProperty :: PackageProperty -> Doc Source #

Pretty-prints a package property.

data PackageConstraint Source #

A package constraint consists of a scope plus a property that must hold for all packages within that scope.

dispPackageConstraint :: PackageConstraint -> Doc Source #

Pretty-prints a package constraint.

showPackageConstraint :: PackageConstraint -> String Source #

Alternative textual representation of a package constraint for debugging purposes (slightly more verbose than that produced by dispPackageConstraint).