HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecabal-install-solver-3.12.1.0Haskell2010

Distribution.Solver.Modular.Dependency

  • 16 types
  • 14 values

Variables

3 declarations
datadata Var qpn
#

The type of variables that play a role in the solver. Note that the tree currently does not use this type directly, and rather has separate tree nodes for the different types of variables. This fits better with the fact that in most cases, these have to be treated differently.

Constructors

Instances4Functor, Eq, Ord, Show
  • Functor VarDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Var
  • Eq qpn => Eq (Var qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Var
  • Ord qpn => Ord (Var qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Var
  • Show qpn => Show (Var qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Var
valuevarPN :: Var qpn -> qpn
#

Extract the package name from a Var

Conflict sets

3 declarations
newtypenewtype ConflictSet
#

The set of variables involved in a solver conflict, each paired with details about the conflict.

Instances2Eq, Show
  • Eq ConflictSetDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.ConflictSet
  • Show ConflictSetDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.ConflictSet

Constrained instances

1 declaration
datadata CI
#

Constrained instance. It represents the allowed instances for a package, which can be either a fixed instance or a version range.

Constructors

Instances2Eq, Show
  • Eq CIDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Show CIDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency

Flagged dependencies

12 declarations
typetype FlaggedDeps qpn = [FlaggedDep qpn]
#

Flagged dependencies

FlaggedDeps is the modular solver's view of a packages dependencies: rather than having the dependencies indexed by component, each dependency defines what component it is in.

Note that each dependency is associated with a Component. We must know what component the dependencies belong to, or else we won't be able to construct fine-grained reverse dependencies.

datadata FlaggedDep qpn
#

Flagged dependencies can either be plain dependency constraints, or flag-dependent dependency trees.

Constructors

  • Flagged (FN qpn) FInfo (TrueFlaggedDeps qpn) (FalseFlaggedDeps qpn)

    Dependencies which are conditional on a flag choice.

  • Stanza (SN qpn) (TrueFlaggedDeps qpn)

    Dependencies which are conditional on whether or not a stanza (e.g., a test suite or benchmark) is enabled.

  • Simple (LDep qpn) Component

    Dependencies which are always enabled, for the component comp.

datadata LDep qpn
#

A Dep labeled with the reason it was introduced.

LDep intentionally has no Functor instance because the type variable is used both to record the dependencies as well as who's doing the depending; having a Functor instance makes bugs where we don't distinguish these two far too likely. (By rights LDep ought to have two type variables.)

Constructors

datadata Dep qpn
#

A dependency (constraint) associates a package name with a constrained instance. It can also represent other types of dependencies, such as dependencies on language extensions.

Constructors

Instances1Functor
  • Functor DepDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
datadata PkgComponent qpn
#

An exposed component within a package. This type is used to represent build-depends and build-tool-depends dependencies.

Instances4Functor, Eq, Ord, Show
  • Functor PkgComponentDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Eq qpn => Eq (PkgComponent qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Ord qpn => Ord (PkgComponent qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Show qpn => Show (PkgComponent qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
datadata ExposedComponent
#

A component that can be depended upon by another package, i.e., a library or an executable.

Instances3Eq, Ord, Show
  • Eq ExposedComponentDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Ord ExposedComponentDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Show ExposedComponentDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
datadata DependencyReason qpn
#

The reason that a dependency is active. It identifies the package and any flag and stanza choices that introduced the dependency. It contains everything needed for creating ConflictSets or describing conflicts in solver log messages.

Instances3Functor, Eq, Show
  • Functor DependencyReasonDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Eq qpn => Eq (DependencyReason qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Show qpn => Show (DependencyReason qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency

Apply built-in rules for package qualifiers

Although the behaviour of qualifyDeps depends on the QualifyOptions, it is important that these QualifyOptions are _static_. Qualification does NOT depend on flag assignment; in other words, it behaves the same no matter which choices the solver makes (modulo the global QualifyOptions); we rely on this in linkDeps (see comment there).

NOTE: It's the _dependencies_ of a package that may or may not be independent from the package itself. Package flag choices must of course be consistent.

Remove qualifiers from set of dependencies

This is used during link validation: when we link package Q.A to Q'.A, then all dependencies Q.B need to be linked to Q'.B. In order to compute what to link these dependencies to, we need to requalify Q.B to become Q'.B; we do this by first removing all qualifiers and then calling qualifyDeps again.

Reverse dependency map

1 declaration

Goals

10 declarations
datadata Goal qpn
#

A goal is just a solver variable paired with a reason. The reason is only used for tracing.

Constructors

Instances3Functor, Eq, Show
  • Functor GoalDefined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Eq qpn => Eq (Goal qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency
  • Show qpn => Show (Goal qpn)Defined in cabal-install-solver-3.12.1.0 · Distribution.Solver.Modular.Dependency

Convert a GoalReason to a ConflictSet containing the reason that the conflict occurred, namely the conflict set variables caused a conflict by introducing the given package goal. See the documentation for GoalConflict.

This function currently only specifies the reason for the conflict in the simple case where the GoalReason does not involve any flags or stanzas. Otherwise, it falls back to calling goalReasonToConflictSet.

Convert a DependencyReason to a ConflictSet specifying that the conflict occurred because the conflict set variables introduced a problematic version constraint. See the documentation for VersionConstraintConflict.

This function currently only specifies the reason for the conflict in the simple case where the DependencyReason does not involve any flags or stanzas. Otherwise, it falls back to calling dependencyReasonToConflictSet.

Convert a DependencyReason to a ConflictSet specifying that the conflict occurred because the conflict set variables introduced a version of a package that was excluded by a version constraint. See the documentation for VersionConflict.

This function currently only specifies the reason for the conflict in the simple case where the DependencyReason does not involve any flags or stanzas. Otherwise, it falls back to calling dependencyReasonToConflictSet.