HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulecabal-install-solver-3.18.1.0Haskell2010

Distribution.Solver.Modular.WeightedPSQ

  • 1 type
  • 12 values
newtypenewtype WeightedPSQ w k v
#

An association list that is sorted by weight.

Each element has a key (k), value (v), and weight (w). All operations that add elements or modify weights stably sort the elements by weight.

Instances5Functor, Foldable, Traversable, Eq, Show
  • Functor (WeightedPSQ w k)Defined in cabal-install-solver-3.18.1.0 · Distribution.Solver.Modular.WeightedPSQ
  • Foldable (WeightedPSQ w k)Defined in cabal-install-solver-3.18.1.0 · Distribution.Solver.Modular.WeightedPSQ
  • Traversable (WeightedPSQ w k)Defined in cabal-install-solver-3.18.1.0 · Distribution.Solver.Modular.WeightedPSQ
  • (Eq w, Eq k, Eq v) => Eq (WeightedPSQ w k v)Defined in cabal-install-solver-3.18.1.0 · Distribution.Solver.Modular.WeightedPSQ
  • (Show w, Show k, Show v) => Show (WeightedPSQ w k v)Defined in cabal-install-solver-3.18.1.0 · Distribution.Solver.Modular.WeightedPSQ
valuelookup :: Eq k => k -> WeightedPSQ w k v -> Maybe v
#

O(N). Return the value associated with the first occurrence of the give key, if it exists.

valueunion
  1. :: Ord w
  2. => WeightedPSQ w k v
  3. -> WeightedPSQ w k v
  4. -> WeightedPSQ w k v
#

O((N + M) log (N + M)). Combine two WeightedPSQs, preserving all elements. Elements from the first WeightedPSQ come before elements in the second when they have the same weight.

valuetakeUntil :: (v -> Bool) -> WeightedPSQ w k v -> WeightedPSQ w k v
#

O(N). Return the prefix of values ending with the first element that satisfies p, or all elements if none satisfy p.