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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Distribution.Solver.Modular.PSQ

Synopsis

- newtype PSQ k v = PSQ [(k, v)]
- casePSQ :: PSQ k a -> r -> (k -> a -> PSQ k a -> r) -> r
- cons :: k -> a -> PSQ k a -> PSQ k a
- length :: PSQ k a -> Int
- lookup :: Eq k => k -> PSQ k v -> Maybe v
- filter :: (a -> Bool) -> PSQ k a -> PSQ k a
- filterIfAny :: (a -> Bool) -> PSQ k a -> PSQ k a
- filterIfAnyByKeys :: (k -> Bool) -> PSQ k a -> PSQ k a
- filterKeys :: (k -> Bool) -> PSQ k a -> PSQ k a
- firstOnly :: PSQ k a -> PSQ k a
- fromList :: [(k, a)] -> PSQ k a
- isZeroOrOne :: PSQ k a -> Bool
- keys :: PSQ k v -> [k]
- map :: (v1 -> v2) -> PSQ k v1 -> PSQ k v2
- mapKeys :: (k1 -> k2) -> PSQ k1 v -> PSQ k2 v
- mapWithKey :: (k -> a -> b) -> PSQ k a -> PSQ k b
- maximumBy :: (k -> Int) -> PSQ k a -> (k, a)
- minimumBy :: (a -> Int) -> PSQ k a -> PSQ k a
- null :: PSQ k a -> Bool
- prefer :: (a -> Bool) -> PSQ k a -> PSQ k a
- preferByKeys :: (k -> Bool) -> PSQ k a -> PSQ k a
- snoc :: PSQ k a -> k -> a -> PSQ k a
- sortBy :: (a -> a -> Ordering) -> PSQ k a -> PSQ k a
- sortByKeys :: (k -> k -> Ordering) -> PSQ k a -> PSQ k a
- toList :: PSQ k a -> [(k, a)]
- union :: PSQ k a -> PSQ k a -> PSQ k a

# Documentation

newtype PSQ k v Source #

Constructors

PSQ [(k, v)] |

#### Instances

Instances details

Functor (PSQ k) Source # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods fmap :: (a -> b) -> PSQ k a -> PSQ k b Source # (<$) :: a -> PSQ k b -> PSQ k a Source #
Foldable (PSQ k) Source # |

Instance details

Defined in Distribution.Solver.Modular.PSQ

Methods

fold :: Monoid m => PSQ k m -> m Source #

foldMap :: Monoid m => (a -> m) -> PSQ k a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PSQ k a -> m Source #

foldr :: (a -> b -> b) -> b -> PSQ k a -> b Source #

foldr' :: (a -> b -> b) -> b -> PSQ k a -> b Source #

foldl :: (b -> a -> b) -> b -> PSQ k a -> b Source #

foldl' :: (b -> a -> b) -> b -> PSQ k a -> b Source #

foldr1 :: (a -> a -> a) -> PSQ k a -> a Source #

foldl1 :: (a -> a -> a) -> PSQ k a -> a Source #

toList :: PSQ k a -> [a] Source #

null :: PSQ k a -> Bool Source #

length :: PSQ k a -> Int Source #

elem :: Eq a => a -> PSQ k a -> Bool Source #

maximum :: Ord a => PSQ k a -> a Source #

minimum :: Ord a => PSQ k a -> a Source #

sum :: Num a => PSQ k a -> a Source #

product :: Num a => PSQ k a -> a Source #

Traversable (PSQ k) Source # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods traverse :: Applicative f => (a -> f b) -> PSQ k a -> f (PSQ k b) Source # sequenceA :: Applicative f => PSQ k (f a) -> f (PSQ k a) Source # mapM :: Monad m => (a -> m b) -> PSQ k a -> m (PSQ k b) Source # sequence :: Monad m => PSQ k (m a) -> m (PSQ k a) Source #
(Show k, Show v) => Show (PSQ k v) Source # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods showsPrec :: Int -> PSQ k v -> ShowS Source # show :: PSQ k v -> String Source # showList :: [PSQ k v] -> ShowS Source #
(Eq k, Eq v) => Eq (PSQ k v) Source # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods (==) :: PSQ k v -> PSQ k v -> Bool Source # (/=) :: PSQ k v -> PSQ k v -> Bool Source #

casePSQ :: PSQ k a -> r -> (k -> a -> PSQ k a -> r) -> r Source #

cons :: k -> a -> PSQ k a -> PSQ k a Source #

length :: PSQ k a -> Int Source #

lookup :: Eq k => k -> PSQ k v -> Maybe v Source #

filter :: (a -> Bool) -> PSQ k a -> PSQ k a Source #

filterIfAny :: (a -> Bool) -> PSQ k a -> PSQ k a Source #

Will partition the list according to the predicate. If there is any element that satisfies the predicate, then only the elements satisfying the predicate are returned. Otherwise, the rest is returned.

filterIfAnyByKeys :: (k -> Bool) -> PSQ k a -> PSQ k a Source #

Variant of `filterIfAny` that takes a predicate on the keys rather than on the values.

filterKeys :: (k -> Bool) -> PSQ k a -> PSQ k a Source #

firstOnly :: PSQ k a -> PSQ k a Source #

fromList :: [(k, a)] -> PSQ k a Source #

isZeroOrOne :: PSQ k a -> Bool Source #

keys :: PSQ k v -> [k] Source #

map :: (v1 -> v2) -> PSQ k v1 -> PSQ k v2 Source #

mapKeys :: (k1 -> k2) -> PSQ k1 v -> PSQ k2 v Source #

mapWithKey :: (k -> a -> b) -> PSQ k a -> PSQ k b Source #

maximumBy :: (k -> Int) -> PSQ k a -> (k, a) Source #

minimumBy :: (a -> Int) -> PSQ k a -> PSQ k a Source #

null :: PSQ k a -> Bool Source #

prefer :: (a -> Bool) -> PSQ k a -> PSQ k a Source #

Sort the list so that values satisfying the predicate are first.

preferByKeys :: (k -> Bool) -> PSQ k a -> PSQ k a Source #

Sort the list so that keys satisfying the predicate are first.

snoc :: PSQ k a -> k -> a -> PSQ k a Source #

sortBy :: (a -> a -> Ordering) -> PSQ k a -> PSQ k a Source #

sortByKeys :: (k -> k -> Ordering) -> PSQ k a -> PSQ k a Source #

toList :: PSQ k a -> [(k, a)] Source #

union :: PSQ k a -> PSQ k a -> PSQ k a Source #