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 #

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

#### Instances

Instances details

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

data Conflict #

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 # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods showsPrec :: Int -> Conflict -> ShowS # show :: Conflict -> String # showList :: [Conflict] -> ShowS #
Eq Conflict # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods (==) :: Conflict -> Conflict -> Bool # (/=) :: Conflict -> Conflict -> Bool #
Ord Conflict # |
Instance details Defined in Distribution.Solver.Modular.ConflictSet Methods compare :: Conflict -> Conflict -> Ordering # (<) :: Conflict -> Conflict -> Bool # (<=) :: Conflict -> Conflict -> Bool # (>) :: Conflict -> Conflict -> Bool # (>=) :: Conflict -> Conflict -> Bool # max :: Conflict -> Conflict -> Conflict # min :: Conflict -> Conflict -> Conflict #

type ConflictMap = Map (Var QPN) Int #

newtype OrderedVersionRange #

Version range with an `Ord` instance.

Constructors

OrderedVersionRange VR |

#### Instances

Instances details

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

Instance details

Defined in Distribution.Solver.Modular.ConflictSet

Methods

compare :: OrderedVersionRange -> OrderedVersionRange -> Ordering #

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

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

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

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

max :: OrderedVersionRange -> OrderedVersionRange -> OrderedVersionRange #

min :: OrderedVersionRange -> OrderedVersionRange -> OrderedVersionRange #

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] #

\(\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 #