Distribution.Solver.Modular.PSQ

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 #

Constructors

PSQ [(k, v)] |

#### Instances

Instances details

Functor (PSQ k) # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods fmap :: (a -> b) -> PSQ k a -> PSQ k b # (<$) :: a -> PSQ k b -> PSQ k a #
Foldable (PSQ k) # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods fold :: Monoid m => PSQ k m -> m # foldMap :: Monoid m => (a -> m) -> PSQ k a -> m # foldMap' :: Monoid m => (a -> m) -> PSQ k a -> m # foldr :: (a -> b -> b) -> b -> PSQ k a -> b # foldr' :: (a -> b -> b) -> b -> PSQ k a -> b # foldl :: (b -> a -> b) -> b -> PSQ k a -> b # foldl' :: (b -> a -> b) -> b -> PSQ k a -> b # foldr1 :: (a -> a -> a) -> PSQ k a -> a # foldl1 :: (a -> a -> a) -> PSQ k a -> a # toList :: PSQ k a -> [a] # null :: PSQ k a -> Bool # length :: PSQ k a -> Int # elem :: Eq a => a -> PSQ k a -> Bool # maximum :: Ord a => PSQ k a -> a # minimum :: Ord a => PSQ k a -> a # sum :: Num a => PSQ k a -> a # product :: Num a => PSQ k a -> a #
Traversable (PSQ k) # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods traverse :: Applicative f => (a -> f b) -> PSQ k a -> f (PSQ k b) # sequenceA :: Applicative f => PSQ k (f a) -> f (PSQ k a) # mapM :: Monad m => (a -> m b) -> PSQ k a -> m (PSQ k b) # sequence :: Monad m => PSQ k (m a) -> m (PSQ k a) #
(Show k, Show v) => Show (PSQ k v) # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods showsPrec :: Int -> PSQ k v -> ShowS # show :: PSQ k v -> String # showList :: [PSQ k v] -> ShowS #
(Eq k, Eq v) => Eq (PSQ k v) # |
Instance details Defined in Distribution.Solver.Modular.PSQ Methods (==) :: PSQ k v -> PSQ k v -> Bool # (/=) :: PSQ k v -> PSQ k v -> Bool #

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 #

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 #

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

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 #

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

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

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

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 #