Joint ordered fold over two maps in increasing comparator order.
The callback sees some exactly on the sides that contain a
comparator-equivalent key; at a shared entry it receives the left map's key
representative. The implementation performs linear merge work after
materializing the two ordered streams.
Equations
- Std.ExtTreeMap.foldl₂ f init left right = Std.ExtTreeMap.foldl₂.mergeFold f init left.toList right.toList
Instances For
Joint-fold worker. Nesting keeps it out of the top-level
Std.ExtTreeMap namespace, but exposure makes it a public constant. Callers
must supply sorted, comparator-distinct streams, as ExtTreeMap.toList
produces; behavior on other lists is unspecified.
Equations
- One or more equations did not get rendered due to their size.
- Std.ExtTreeMap.foldl₂.mergeFold f a✝¹ [] a✝ = List.foldl (fun (acc : δ) (entry : α × γ) => f acc entry.fst none (some entry.snd)) a✝¹ a✝
- Std.ExtTreeMap.foldl₂.mergeFold f a✝¹ a✝ [] = List.foldl (fun (acc : δ) (entry : α × β) => f acc entry.fst (some entry.snd) none) a✝¹ a✝
Instances For
Result for one key in a deletion-capable merge.
Equations
- Std.ExtTreeMap.mergeValue? f key none x✝ = x✝
- Std.ExtTreeMap.mergeValue? f key x✝ none = x✝
- Std.ExtTreeMap.mergeValue? f key (some left) (some right) = f key left right
Instances For
Merge two maps, allowing a collision to delete its key.
Left-only and right-only entries are retained unchanged. The smaller map is
folded into the larger map, so the operation performs
O(min(m,n) * log(max(m,n))) tree work. The collision callback always receives
the left value before the right value, independent of which map is smaller.
LawfulEqCmp makes comparator-equivalent keys propositionally equal, so the
choice of the larger map cannot observably change the stored collision key.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lookup specification for a deletion-capable merge.