Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- data ConstraintScope
- scopeToplevel :: PackageName -> ConstraintScope
- scopeToPackageName :: ConstraintScope -> PackageName
- constraintScopeMatches :: ConstraintScope -> QPN -> Bool
- data PackageProperty
- = PackagePropertyVersion VersionRange
- | PackagePropertyInstalled
- | PackagePropertySource
- | PackagePropertyFlags FlagAssignment
- | PackagePropertyStanzas [OptionalStanza]
- dispPackageProperty :: PackageProperty -> Doc
- data PackageConstraint = PackageConstraint ConstraintScope PackageProperty
- dispPackageConstraint :: PackageConstraint -> Doc
- showPackageConstraint :: PackageConstraint -> String
- packageConstraintToDependency :: PackageConstraint -> Maybe PackageVersionConstraint
Documentation
data ConstraintScope Source #
Determines to what packages and in what contexts a constraint applies.
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. |
Instances
Show ConstraintScope Source # | |
Defined in Distribution.Solver.Types.PackageConstraint showsPrec :: Int -> ConstraintScope -> ShowS # show :: ConstraintScope -> String # showList :: [ConstraintScope] -> ShowS # | |
Eq ConstraintScope Source # | |
Defined in Distribution.Solver.Types.PackageConstraint (==) :: ConstraintScope -> ConstraintScope -> Bool # (/=) :: ConstraintScope -> ConstraintScope -> Bool # |
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.
constraintScopeMatches :: ConstraintScope -> QPN -> Bool Source #
data PackageProperty Source #
A package property is a logical predicate on packages.
PackagePropertyVersion VersionRange | |
PackagePropertyInstalled | |
PackagePropertySource | |
PackagePropertyFlags FlagAssignment | |
PackagePropertyStanzas [OptionalStanza] |
Instances
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.
Instances
Show PackageConstraint Source # | |
Defined in Distribution.Solver.Types.PackageConstraint showsPrec :: Int -> PackageConstraint -> ShowS # show :: PackageConstraint -> String # showList :: [PackageConstraint] -> ShowS # | |
Eq PackageConstraint Source # | |
Defined in Distribution.Solver.Types.PackageConstraint (==) :: PackageConstraint -> PackageConstraint -> Bool # (/=) :: PackageConstraint -> PackageConstraint -> Bool # |
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
).
packageConstraintToDependency :: PackageConstraint -> Maybe PackageVersionConstraint Source #
Lossily convert a PackageConstraint
to a Dependency
.