unionWith -package:dhall
The union with a combining function.
unionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "aA"), (7, "C")]
Also see the performance note on
fromListWith.
Union with a combining function.
unionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "aA"), (7, "C")]
Also see the performance note on
fromListWith.
The union with a combining function.
The union of two maps. If a key occurs in both maps, the
provided function (first argument) will be used to compute the result.
The union with a combining function.
unionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "aA"), (7, "C")]
The union of two maps. If a key occurs in both maps, the
provided function (first argument) will be used to compute the result.
O(m*log(n/m + 1)), m <= n. Union with a combining function.
unionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "aA"), (7, "C")]
Combine two maps.
When a key exists in both maps, apply a function to both of the values
and use the result of that as the value of the key in the resulting
map.
forAllNonEmptyMap $ \xs -> forAllNonEmptyMap $ \ys -> Map.unionWith (++) (NonEmptyMap.flatten xs) (NonEmptyMap.flatten ys) == NonEmptyMap.flatten (NonEmptyMap.unionWith (++) xs ys)
The union of two maps. If a key occurs in both maps, the provided
function (first argument) will be used to compute the result.
Ordered traversal will go thru keys in the first map first.
Take the union of two tries, using a function to resolve conflicts.
The resulting trie is constructed strictly, but the results of the
combining function are evaluated lazily.
Merge two event streams of the same type. The function argument
specifies how event values are to be combined in case of a
simultaneous occurrence. The semantics are
unionWith f ((timex,x):xs) ((timey,y):ys)
| timex < timey = (timex,x) : unionWith f xs ((timey,y):ys)
| timex > timey = (timey,y) : unionWith f ((timex,x):xs) ys
| timex == timey = (timex,f x y) : unionWith f xs ys
Union. The function is used to combine edge labels for edges that
occur in both graphs (labels from the first graph are given as the
first argument to the function).
Time complexity: O(n₁ log (n₂n₁ + 1) + e₁ log e₂), where
n₁/ is the number of nodes in the graph with the smallest number
of nodes and n₂ is the number of nodes in the other graph, and
e₁ is the number of edges in the graph with the smallest number
of edges and e₂ is the number of edges in the other graph.
Less complicated time complexity: O((n + e) log n (where
n and e refer to the resulting graph).
Pointwise union with merge function for values.
The union with a combining function.
O(m*log(n/m + 1)), m <= n. Union with a combining function.
unionWith (++) (fromList ((5, "a") :| [(3, "b")])) (fromList ((5, "A") :| [(7, "C")])) == fromList ((3, "b") :| [(5, "aA"), (7, "C")])
O(m*log(n/m + 1)), m <= n. Union with a combining function.
unionWith (++) (fromList ((5, "a") :| [(3, "b")])) (fromList ((5, "A") :| [(7, "C")])) == fromList ((3, "b") :| [(5, "aA"), (7, "C")])