cabal-install-solver-3.12.1.0: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Solver.Modular.ConflictSet

Description

Conflict sets

Intended for double import

    import Distribution.Solver.Modular.ConflictSet (ConflictSet)
    import qualified Distribution.Solver.Modular.ConflictSet as CS

Synopsis

- data ConflictSet
- data Conflict
  - = GoalConflict QPN
  - | VersionConstraintConflict QPN Ver
  - | VersionConflict QPN OrderedVersionRange
  - | OtherConflict
- type ConflictMap = Map (Var QPN) Int
- newtype OrderedVersionRange = OrderedVersionRange VR
- showConflictSet :: ConflictSet -> String
- showCSSortedByFrequency :: ConflictMap -> ConflictSet -> String
- showCSWithFrequency :: ConflictMap -> ConflictSet -> String
- toSet :: ConflictSet -> Set (Var QPN)
- toList :: ConflictSet -> [Var QPN]
- union :: ConflictSet -> ConflictSet -> ConflictSet
- unions :: [ConflictSet] -> ConflictSet
- insert :: Var QPN -> ConflictSet -> ConflictSet
- delete :: Var QPN -> ConflictSet -> ConflictSet
- empty :: ConflictSet
- singleton :: Var QPN -> ConflictSet
- singletonWithConflict :: Var QPN -> Conflict -> ConflictSet
- size :: ConflictSet -> Int
- member :: Var QPN -> ConflictSet -> Bool
- lookup :: Var QPN -> ConflictSet -> Maybe (Set Conflict)
- filter :: (a -> Bool) -> [a] -> [a]
- fromList :: [Var QPN] -> ConflictSet

# Documentation

data ConflictSet Source #

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

#### Instances

Instances details

Show ConflictSet Source # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods showsPrec :: Int -> ConflictSet -> ShowS Source # show :: ConflictSet -> String Source # showList :: [ConflictSet] -> ShowS Source #
Eq ConflictSet Source # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods (==) :: ConflictSet -> ConflictSet -> Bool Source # (/=) :: ConflictSet -> ConflictSet -> Bool Source #

data Conflict Source #

More detailed information about how a conflict set variable caused a conflict. This information can be used to determine whether a second value for that variable would lead to the same conflict.

TODO: Handle dependencies under flags or stanzas.

Constructors

GoalConflict QPN | The conflict set variable represents a package which depends on the specified problematic package. For example, the conflict set entry '(P x, GoalConflict y)' means that package x introduced package y, and y led to a conflict.
VersionConstraintConflict QPN Ver | The conflict set variable represents a package with a constraint that excluded the specified package and version. For example, the conflict set entry '(P x, VersionConstraintConflict y (mkVersion [2, 0]))' means that package x's constraint on y excluded y-2.0.
VersionConflict QPN OrderedVersionRange | The conflict set variable represents a package that was excluded by a constraint from the specified package. For example, the conflict set entry '(P x, VersionConflict y (orLaterVersion (mkVersion [2, 0])))' means that package y's constraint 'x >= 2.0' excluded some version of x.
OtherConflict | Any other conflict.

#### Instances

Instances details

Show Conflict Source # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods showsPrec :: Int -> Conflict -> ShowS Source # show :: Conflict -> String Source # showList :: [Conflict] -> ShowS Source #
Eq Conflict Source # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods (==) :: Conflict -> Conflict -> Bool Source # (/=) :: Conflict -> Conflict -> Bool Source #
Ord Conflict Source # |

Instance details

Defined in Distribution.Solver.Modular.ConflictSet

Methods

compare :: Conflict -> Conflict -> Ordering Source #

(<) :: Conflict -> Conflict -> Bool Source #

(<=) :: Conflict -> Conflict -> Bool Source #

(>) :: Conflict -> Conflict -> Bool Source #

(>=) :: Conflict -> Conflict -> Bool Source #

max :: Conflict -> Conflict -> Conflict Source #

min :: Conflict -> Conflict -> Conflict Source #

type ConflictMap = Map (Var QPN) Int Source #

newtype OrderedVersionRange Source #

Version range with an `Ord` instance.

Constructors

OrderedVersionRange VR |

#### Instances

Instances details

Show OrderedVersionRange Source # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods showsPrec :: Int -> OrderedVersionRange -> ShowS Source # show :: OrderedVersionRange -> String Source # showList :: [OrderedVersionRange] -> ShowS Source #
Eq OrderedVersionRange Source # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods (==) :: OrderedVersionRange -> OrderedVersionRange -> Bool Source # (/=) :: OrderedVersionRange -> OrderedVersionRange -> Bool Source #
Ord OrderedVersionRange Source # |

Instance details

Defined in Distribution.Solver.Modular.ConflictSet

Methods

compare :: OrderedVersionRange -> OrderedVersionRange -> Ordering Source #

(<) :: OrderedVersionRange -> OrderedVersionRange -> Bool Source #

(<=) :: OrderedVersionRange -> OrderedVersionRange -> Bool Source #

(>) :: OrderedVersionRange -> OrderedVersionRange -> Bool Source #

(>=) :: OrderedVersionRange -> OrderedVersionRange -> Bool Source #

max :: OrderedVersionRange -> OrderedVersionRange -> OrderedVersionRange Source #

min :: OrderedVersionRange -> OrderedVersionRange -> OrderedVersionRange Source #

showConflictSet :: ConflictSet -> String Source #

showCSSortedByFrequency :: ConflictMap -> ConflictSet -> String Source #

showCSWithFrequency :: ConflictMap -> ConflictSet -> String Source #

toSet :: ConflictSet -> Set (Var QPN) Source #

toList :: ConflictSet -> [Var QPN] Source #

union :: ConflictSet -> ConflictSet -> ConflictSet Source #

unions :: [ConflictSet] -> ConflictSet Source #

insert :: Var QPN -> ConflictSet -> ConflictSet Source #

delete :: Var QPN -> ConflictSet -> ConflictSet Source #

empty :: ConflictSet Source #

singleton :: Var QPN -> ConflictSet Source #

singletonWithConflict :: Var QPN -> Conflict -> ConflictSet Source #

size :: ConflictSet -> Int Source #

member :: Var QPN -> ConflictSet -> Bool Source #

lookup :: Var QPN -> ConflictSet -> Maybe (Set Conflict) Source #

filter :: (a -> Bool) -> [a] -> [a] Source #

\(\mathcal{O}(n)\). `filter`, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,

    filter p xs = [ x | x <- xs, p x]

#### Examples

Expand

    >>> filter odd [1, 2, 3]
    [1,3]

    >>> filter (\l -> length l > 3) ["Hello", ", ", "World", "!"]
    ["Hello","World"]

    >>> filter (/= 3) [1, 2, 3, 4, 3, 2, 1]
    [1,2,4,2,1]

fromList :: [Var QPN] -> ConflictSet Source #