{-# LANGUAGE CPP #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Data.PQueue.Prio.Min (
#if __GLASGOW_HASKELL__ >= 802
MinPQueue (Data.PQueue.Prio.Min.Empty, (:<)),
#elif defined (__GLASGOW_HASKELL__)
MinPQueue,
pattern Data.PQueue.Prio.Min.Empty,
pattern (:<),
#endif
empty,
singleton,
insert,
insertBehind,
union,
unions,
null,
size,
findMin,
getMin,
deleteMin,
deleteFindMin,
adjustMin,
adjustMinA,
adjustMinWithKey,
adjustMinWithKeyA,
updateMin,
updateMinA,
updateMinWithKey,
updateMinWithKeyA,
minView,
minViewWithKey,
map,
mapWithKey,
mapKeys,
mapKeysMonotonic,
foldrWithKey,
foldlWithKey,
traverseWithKey,
mapMWithKey,
take,
drop,
splitAt,
takeWhile,
takeWhileWithKey,
dropWhile,
dropWhileWithKey,
span,
spanWithKey,
break,
breakWithKey,
filter,
filterWithKey,
partition,
partitionWithKey,
mapMaybe,
mapMaybeWithKey,
mapEither,
mapEitherWithKey,
fromList,
fromAscList,
fromDescList,
keys,
elems,
assocs,
toAscList,
toDescList,
toList,
foldrU,
foldMapWithKeyU,
foldrWithKeyU,
foldlU,
foldlU',
foldlWithKeyU,
foldlWithKeyU',
traverseU,
traverseWithKeyU,
keysU,
elemsU,
assocsU,
toListU,
seqSpine
)
where
import qualified Data.List as List
import Data.Maybe (fromMaybe)
#if MIN_VERSION_base(4,9,0)
import Data.Semigroup (Semigroup((<>)))
#endif
import Data.PQueue.Prio.Internals hiding (MinPQueue (..))
import Data.PQueue.Prio.Internals (MinPQueue)
import qualified Data.PQueue.Prio.Internals as Internals
import Prelude hiding (map, filter, break, span, takeWhile, dropWhile, splitAt, take, drop, (!!), null)
#ifdef __GLASGOW_HASKELL__
pattern Empty :: MinPQueue k a
pattern $bEmpty :: forall k a. MinPQueue k a
$mEmpty :: forall {r} {k} {a}.
MinPQueue k a -> ((# #) -> r) -> ((# #) -> r) -> r
Empty = Internals.Empty
# if __GLASGOW_HASKELL__ >= 902
{-# INLINE CONLIKE Empty #-}
# endif
infixr 5 :<
# if __GLASGOW_HASKELL__ >= 800
pattern (:<) :: Ord k => (k, a) -> MinPQueue k a -> MinPQueue k a
# else
pattern (:<) :: () => Ord k => (k, a) -> MinPQueue k a -> MinPQueue k a
# endif
pattern ka $b:< :: forall k a. Ord k => (k, a) -> MinPQueue k a -> MinPQueue k a
$m:< :: forall {r} {k} {a}.
Ord k =>
MinPQueue k a
-> ((k, a) -> MinPQueue k a -> r) -> ((# #) -> r) -> r
:< q <- (minViewWithKey -> Just (ka, q))
where
(k
k, a
a) :< MinPQueue k a
q = forall k a. Ord k => k -> a -> MinPQueue k a -> MinPQueue k a
insert k
k a
a MinPQueue k a
q
# if __GLASGOW_HASKELL__ >= 902
{-# INLINE (:<) #-}
# endif
{-# COMPLETE Empty, (:<) #-}
#endif
(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
(c -> d
f .: :: forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: a -> b -> c
g) a
x b
y = c -> d
f (a -> b -> c
g a
x b
y)
uncurry' :: (a -> b -> c) -> (a, b) -> c
uncurry' :: forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry' a -> b -> c
f (a
a, b
b) = a -> b -> c
f a
a b
b
infixr 8 .:
findMin :: MinPQueue k a -> (k, a)
findMin :: forall k a. MinPQueue k a -> (k, a)
findMin = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => [Char] -> a
error [Char]
"Error: findMin called on an empty queue") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. MinPQueue k a -> Maybe (k, a)
getMin
deleteMin :: Ord k => MinPQueue k a -> MinPQueue k a
deleteMin :: forall k a. Ord k => MinPQueue k a -> MinPQueue k a
deleteMin = forall k a.
Ord k =>
(a -> Maybe a) -> MinPQueue k a -> MinPQueue k a
updateMin (forall a b. a -> b -> a
const forall a. Maybe a
Nothing)
deleteFindMin :: Ord k => MinPQueue k a -> ((k, a), MinPQueue k a)
deleteFindMin :: forall k a. Ord k => MinPQueue k a -> ((k, a), MinPQueue k a)
deleteFindMin = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => [Char] -> a
error [Char]
"Error: deleteFindMin called on an empty queue") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => MinPQueue k a -> Maybe ((k, a), MinPQueue k a)
minViewWithKey
adjustMin :: (a -> a) -> MinPQueue k a -> MinPQueue k a
adjustMin :: forall a k. (a -> a) -> MinPQueue k a -> MinPQueue k a
adjustMin = forall k a. (k -> a -> a) -> MinPQueue k a -> MinPQueue k a
adjustMinWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
adjustMinA :: Applicative f => (a -> f a) -> MinPQueue k a -> f (MinPQueue k a)
adjustMinA :: forall (f :: * -> *) a k.
Applicative f =>
(a -> f a) -> MinPQueue k a -> f (MinPQueue k a)
adjustMinA = forall (f :: * -> *) k a.
Applicative f =>
(k -> a -> f a) -> MinPQueue k a -> f (MinPQueue k a)
adjustMinWithKeyA forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
adjustMinWithKeyA :: Applicative f => (k -> a -> f a) -> MinPQueue k a -> f (MinPQueue k a)
adjustMinWithKeyA :: forall (f :: * -> *) k a.
Applicative f =>
(k -> a -> f a) -> MinPQueue k a -> f (MinPQueue k a)
adjustMinWithKeyA = forall (f :: * -> *) k a r.
Applicative f =>
(MinPQueue k a -> r) -> (k -> a -> f a) -> MinPQueue k a -> f r
adjustMinWithKeyA' forall a. a -> a
id
updateMin :: Ord k => (a -> Maybe a) -> MinPQueue k a -> MinPQueue k a
updateMin :: forall k a.
Ord k =>
(a -> Maybe a) -> MinPQueue k a -> MinPQueue k a
updateMin = forall k a.
Ord k =>
(k -> a -> Maybe a) -> MinPQueue k a -> MinPQueue k a
updateMinWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
updateMinA :: (Applicative f, Ord k) => (a -> f (Maybe a)) -> MinPQueue k a -> f (MinPQueue k a)
updateMinA :: forall (f :: * -> *) k a.
(Applicative f, Ord k) =>
(a -> f (Maybe a)) -> MinPQueue k a -> f (MinPQueue k a)
updateMinA = forall (f :: * -> *) k a.
(Applicative f, Ord k) =>
(k -> a -> f (Maybe a)) -> MinPQueue k a -> f (MinPQueue k a)
updateMinWithKeyA forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
updateMinWithKeyA :: (Applicative f, Ord k) => (k -> a -> f (Maybe a)) -> MinPQueue k a -> f (MinPQueue k a)
updateMinWithKeyA :: forall (f :: * -> *) k a.
(Applicative f, Ord k) =>
(k -> a -> f (Maybe a)) -> MinPQueue k a -> f (MinPQueue k a)
updateMinWithKeyA = forall (f :: * -> *) k a r.
(Applicative f, Ord k) =>
(MinPQueue k a -> r)
-> (k -> a -> f (Maybe a)) -> MinPQueue k a -> f r
updateMinWithKeyA' forall a. a -> a
id
minView :: Ord k => MinPQueue k a -> Maybe (a, MinPQueue k a)
minView :: forall k a. Ord k => MinPQueue k a -> Maybe (a, MinPQueue k a)
minView MinPQueue k a
q = do ((k
_, a
a), MinPQueue k a
q') <- forall k a. Ord k => MinPQueue k a -> Maybe ((k, a), MinPQueue k a)
minViewWithKey MinPQueue k a
q
forall (m :: * -> *) a. Monad m => a -> m a
return (a
a, MinPQueue k a
q')
map :: (a -> b) -> MinPQueue k a -> MinPQueue k b
map :: forall a b k. (a -> b) -> MinPQueue k a -> MinPQueue k b
map = forall k a b. (k -> a -> b) -> MinPQueue k a -> MinPQueue k b
mapWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
mapKeys :: Ord k' => (k -> k') -> MinPQueue k a -> MinPQueue k' a
mapKeys :: forall k' k a.
Ord k' =>
(k -> k') -> MinPQueue k a -> MinPQueue k' a
mapKeys k -> k'
f MinPQueue k a
q = forall k a. Ord k => [(k, a)] -> MinPQueue k a
fromList [(k -> k'
f k
k, a
a) | (k
k, a
a) <- forall k a. MinPQueue k a -> [(k, a)]
toListU MinPQueue k a
q]
mapMaybe :: Ord k => (a -> Maybe b) -> MinPQueue k a -> MinPQueue k b
mapMaybe :: forall k a b.
Ord k =>
(a -> Maybe b) -> MinPQueue k a -> MinPQueue k b
mapMaybe = forall k a b.
Ord k =>
(k -> a -> Maybe b) -> MinPQueue k a -> MinPQueue k b
mapMaybeWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
mapEither :: Ord k => (a -> Either b c) -> MinPQueue k a -> (MinPQueue k b, MinPQueue k c)
mapEither :: forall k a b c.
Ord k =>
(a -> Either b c)
-> MinPQueue k a -> (MinPQueue k b, MinPQueue k c)
mapEither = forall k a b c.
Ord k =>
(k -> a -> Either b c)
-> MinPQueue k a -> (MinPQueue k b, MinPQueue k c)
mapEitherWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
filter :: Ord k => (a -> Bool) -> MinPQueue k a -> MinPQueue k a
filter :: forall k a. Ord k => (a -> Bool) -> MinPQueue k a -> MinPQueue k a
filter = forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
filterWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
filterWithKey :: Ord k => (k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
filterWithKey :: forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
filterWithKey k -> a -> Bool
p = forall k a b.
Ord k =>
(k -> a -> Maybe b) -> MinPQueue k a -> MinPQueue k b
mapMaybeWithKey (\k
k a
a -> if k -> a -> Bool
p k
k a
a then forall a. a -> Maybe a
Just a
a else forall a. Maybe a
Nothing)
partition :: Ord k => (a -> Bool) -> MinPQueue k a -> (MinPQueue k a, MinPQueue k a)
partition :: forall k a.
Ord k =>
(a -> Bool) -> MinPQueue k a -> (MinPQueue k a, MinPQueue k a)
partition = forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> (MinPQueue k a, MinPQueue k a)
partitionWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
partitionWithKey :: Ord k => (k -> a -> Bool) -> MinPQueue k a -> (MinPQueue k a, MinPQueue k a)
partitionWithKey :: forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> (MinPQueue k a, MinPQueue k a)
partitionWithKey k -> a -> Bool
p = forall k a b c.
Ord k =>
(k -> a -> Either b c)
-> MinPQueue k a -> (MinPQueue k b, MinPQueue k c)
mapEitherWithKey (\k
k a
a -> if k -> a -> Bool
p k
k a
a then forall a b. a -> Either a b
Left a
a else forall a b. b -> Either a b
Right a
a)
{-# INLINE take #-}
take :: Ord k => Int -> MinPQueue k a -> [(k, a)]
take :: forall k a. Ord k => Int -> MinPQueue k a -> [(k, a)]
take Int
n = forall a. Int -> [a] -> [a]
List.take Int
n forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => MinPQueue k a -> [(k, a)]
toAscList
drop :: Ord k => Int -> MinPQueue k a -> MinPQueue k a
drop :: forall k a. Ord k => Int -> MinPQueue k a -> MinPQueue k a
drop Int
n0 MinPQueue k a
q0
| Int
n0 forall a. Ord a => a -> a -> Bool
<= Int
0 = MinPQueue k a
q0
| Int
n0 forall a. Ord a => a -> a -> Bool
>= forall k a. MinPQueue k a -> Int
size MinPQueue k a
q0 = forall k a. MinPQueue k a
empty
| Bool
otherwise = forall {t} {k} {a}.
(Num t, Ord k, Eq t) =>
t -> MinPQueue k a -> MinPQueue k a
drop' Int
n0 MinPQueue k a
q0
where
drop' :: t -> MinPQueue k a -> MinPQueue k a
drop' t
n MinPQueue k a
q
| t
n forall a. Eq a => a -> a -> Bool
== t
0 = MinPQueue k a
q
| Bool
otherwise = t -> MinPQueue k a -> MinPQueue k a
drop' (t
n forall a. Num a => a -> a -> a
- t
1) (forall k a. Ord k => MinPQueue k a -> MinPQueue k a
deleteMin MinPQueue k a
q)
splitAt :: Ord k => Int -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
splitAt :: forall k a.
Ord k =>
Int -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
splitAt Int
n MinPQueue k a
q
| Int
n forall a. Ord a => a -> a -> Bool
<= Int
0 = ([], MinPQueue k a
q)
| Bool
otherwise = Int
n seq :: forall a b. a -> b -> b
`seq` case forall k a. Ord k => MinPQueue k a -> Maybe ((k, a), MinPQueue k a)
minViewWithKey MinPQueue k a
q of
Just ((k, a)
ka, MinPQueue k a
q') -> let ([(k, a)]
kas, MinPQueue k a
q'') = forall k a.
Ord k =>
Int -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
splitAt (Int
n forall a. Num a => a -> a -> a
- Int
1) MinPQueue k a
q' in ((k, a)
ka forall a. a -> [a] -> [a]
: [(k, a)]
kas, MinPQueue k a
q'')
Maybe ((k, a), MinPQueue k a)
_ -> ([], MinPQueue k a
q)
{-# INLINE takeWhile #-}
takeWhile :: Ord k => (a -> Bool) -> MinPQueue k a -> [(k, a)]
takeWhile :: forall k a. Ord k => (a -> Bool) -> MinPQueue k a -> [(k, a)]
takeWhile = forall k a. Ord k => (k -> a -> Bool) -> MinPQueue k a -> [(k, a)]
takeWhileWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
{-# INLINE takeWhileWithKey #-}
takeWhileWithKey :: Ord k => (k -> a -> Bool) -> MinPQueue k a -> [(k, a)]
takeWhileWithKey :: forall k a. Ord k => (k -> a -> Bool) -> MinPQueue k a -> [(k, a)]
takeWhileWithKey k -> a -> Bool
p0 = forall a. (a -> Bool) -> [a] -> [a]
List.takeWhile (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry' k -> a -> Bool
p0) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => MinPQueue k a -> [(k, a)]
toAscList
dropWhile :: Ord k => (a -> Bool) -> MinPQueue k a -> MinPQueue k a
dropWhile :: forall k a. Ord k => (a -> Bool) -> MinPQueue k a -> MinPQueue k a
dropWhile = forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
dropWhileWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
dropWhileWithKey :: Ord k => (k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
dropWhileWithKey :: forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
dropWhileWithKey k -> a -> Bool
p MinPQueue k a
q = case forall k a. Ord k => MinPQueue k a -> Maybe ((k, a), MinPQueue k a)
minViewWithKey MinPQueue k a
q of
Just ((k
k, a
a), MinPQueue k a
q')
| k -> a -> Bool
p k
k a
a -> forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> MinPQueue k a
dropWhileWithKey k -> a -> Bool
p MinPQueue k a
q'
Maybe ((k, a), MinPQueue k a)
_ -> MinPQueue k a
q
span :: Ord k => (a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
span :: forall k a.
Ord k =>
(a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
span = forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
spanWithKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
break :: Ord k => (a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
break :: forall k a.
Ord k =>
(a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
break a -> Bool
p = forall k a.
Ord k =>
(a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
span (Bool -> Bool
not forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
p)
spanWithKey :: Ord k => (k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
spanWithKey :: forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
spanWithKey k -> a -> Bool
p MinPQueue k a
q = case forall k a. Ord k => MinPQueue k a -> Maybe ((k, a), MinPQueue k a)
minViewWithKey MinPQueue k a
q of
Just (t :: (k, a)
t@(k
k, a
a), MinPQueue k a
q')
| k -> a -> Bool
p k
k a
a -> let ([(k, a)]
kas, MinPQueue k a
q'') = forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
spanWithKey k -> a -> Bool
p MinPQueue k a
q' in ((k, a)
t forall a. a -> [a] -> [a]
: [(k, a)]
kas, MinPQueue k a
q'')
Maybe ((k, a), MinPQueue k a)
_ -> ([], MinPQueue k a
q)
breakWithKey :: Ord k => (k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
breakWithKey :: forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
breakWithKey k -> a -> Bool
p = forall k a.
Ord k =>
(k -> a -> Bool) -> MinPQueue k a -> ([(k, a)], MinPQueue k a)
spanWithKey (Bool -> Bool
not forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: k -> a -> Bool
p)
fromDescList :: [(k, a)] -> MinPQueue k a
{-# INLINE fromDescList #-}
fromDescList :: forall k a. [(k, a)] -> MinPQueue k a
fromDescList [(k, a)]
xs = forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
List.foldl' (\MinPQueue k a
q (k
k, a
a) -> forall k a. k -> a -> MinPQueue k a -> MinPQueue k a
insertMin' k
k a
a MinPQueue k a
q) forall k a. MinPQueue k a
empty [(k, a)]
xs
{-# INLINE keys #-}
keys :: Ord k => MinPQueue k a -> [k]
keys :: forall k a. Ord k => MinPQueue k a -> [k]
keys = forall a b. (a -> b) -> [a] -> [b]
List.map forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => MinPQueue k a -> [(k, a)]
toAscList
{-# INLINE elems #-}
elems :: Ord k => MinPQueue k a -> [a]
elems :: forall k a. Ord k => MinPQueue k a -> [a]
elems = forall a b. (a -> b) -> [a] -> [b]
List.map forall a b. (a, b) -> b
snd forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => MinPQueue k a -> [(k, a)]
toAscList
{-# INLINE toList #-}
toList :: Ord k => MinPQueue k a -> [(k, a)]
toList :: forall k a. Ord k => MinPQueue k a -> [(k, a)]
toList = forall k a. Ord k => MinPQueue k a -> [(k, a)]
toAscList
{-# INLINE assocs #-}
assocs :: Ord k => MinPQueue k a -> [(k, a)]
assocs :: forall k a. Ord k => MinPQueue k a -> [(k, a)]
assocs = forall k a. Ord k => MinPQueue k a -> [(k, a)]
toAscList
{-# INLINE keysU #-}
keysU :: MinPQueue k a -> [k]
keysU :: forall k a. MinPQueue k a -> [k]
keysU = forall a b. (a -> b) -> [a] -> [b]
List.map forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. MinPQueue k a -> [(k, a)]
toListU
{-# INLINE elemsU #-}
elemsU :: MinPQueue k a -> [a]
elemsU :: forall k a. MinPQueue k a -> [a]
elemsU = forall a b. (a -> b) -> [a] -> [b]
List.map forall a b. (a, b) -> b
snd forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. MinPQueue k a -> [(k, a)]
toListU
{-# INLINE assocsU #-}
assocsU :: MinPQueue k a -> [(k, a)]
assocsU :: forall k a. MinPQueue k a -> [(k, a)]
assocsU = forall k a. MinPQueue k a -> [(k, a)]
toListU
foldlU :: (b -> a -> b) -> b -> MinPQueue k a -> b
foldlU :: forall b a k. (b -> a -> b) -> b -> MinPQueue k a -> b
foldlU b -> a -> b
f = forall b k a. (b -> k -> a -> b) -> b -> MinPQueue k a -> b
foldlWithKeyU (forall a b. a -> b -> a
const forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> a -> b
f)
foldlU' :: (b -> a -> b) -> b -> MinPQueue k a -> b
foldlU' :: forall b a k. (b -> a -> b) -> b -> MinPQueue k a -> b
foldlU' b -> a -> b
f = forall b k a. (b -> k -> a -> b) -> b -> MinPQueue k a -> b
foldlWithKeyU' (forall a b. a -> b -> a
const forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> a -> b
f)
traverseU :: (Applicative f) => (a -> f b) -> MinPQueue k a -> f (MinPQueue k b)
traverseU :: forall (f :: * -> *) a b k.
Applicative f =>
(a -> f b) -> MinPQueue k a -> f (MinPQueue k b)
traverseU = forall (f :: * -> *) k a b.
Applicative f =>
(k -> a -> f b) -> MinPQueue k a -> f (MinPQueue k b)
traverseWithKeyU forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const