BalancedSearchTree.exchange: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend as BalancedSearchTree Lines 542-547 of bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend&start_line=542&end_line=547 import Base import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as D def exchange(~K: Data, ~V: Data, ~cmp: K -> K -> Cmp, m: TreeMap, +id: Nat, value: Maybe<&2, V>) -> TreeMap & Maybe<&2, V>: match m id: case mm 0n: (mm, None{}) case TM{n, root, lo, hi, free, nodes, payloads} 1n+i: exchange_finish(~K, ~V, ~cmp, n, root, lo, hi, free, nodes, D.swap_at(~Maybe<&2, V>, payloads, i, value)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Cmp https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend&name=TreeMap https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend&name=exchange_finish https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&name=swap_at