foldrWithKey

Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList. For example,
keys map = foldrWithKey (\k x ks -> k:ks) [] map
let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"
foldrWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"
Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList. For example,
keys map = foldrWithKey (\k x ks -> k:ks) [] map
let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"
foldrWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"
Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).
Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).
Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList. For example,
keys map = foldrWithKey (\k x ks -> k:ks) [] map
let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"
foldrWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"
O(n). Fold the keys and values in the IPRTable using the given right-associative binary operator. This function is equivalent to Data.Map.foldrWithKey with necessary to IPRTable changes. Since: 1.7.5
O(n). Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList. For example,
keys map = foldrWithKey (\k x ks -> k:ks) [] map
let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"
foldrWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"
O(n). Post-order fold. The function will be applied from the lowest value to the highest.
Keyed variant of foldr. Warning: This function suffers Bug #25.
Perform a right fold with the key also provided.
Fold the keys and values in the map, such that foldrWithKey f z q == foldr (uncurry f) z (toDescList q). If you do not care about the traversal order, consider using foldrWithKeyU.
Fold the keys and values in the map, such that foldrWithKey f z q == foldr (uncurry f) z (toAscList q). If you do not care about the traversal order, consider using foldrWithKeyU.
O(n). Fold the keys and values in the map using the given right-associative binary operator, taking into account not only the value but also the key.
O(n). Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList. For example,
keysList map = foldrWithKey (\k x ks -> k:ks) [] map
O(n). Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList. For example,
keysList map = foldrWithKey (\k x ks -> k:ks) [] map
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).
O(n). Fold the keys and values in the map using the given right-associative binary operator, such that foldrWithKey f z == foldr (uncurry f) z . toAscList.
Folds over the keys and values in the map using the given right-associative binary operator. Satisfies the following property:
foldrWithKey f r m == Map.foldrWithKey f r (toMap m)
Fold the tree right-to-left.
Fold the tree right-to-left.