BalancedSearchTree.allocate: 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 1389-1395 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=1389&end_line=1395 import Base def allocate(~K: Data, ~V: Data, ~cmp: K -> K -> Cmp, m: TreeMap, +p: Nat, +k: K, +v: V) -> TreeMap & Result<&2, &2, Rejected, Nat>: TM{n, root, lo, hi, free, nodes, payloads} = m match free: case 0n: append(~K, ~V, ~cmp, TM{n, root, lo, hi, 0n, nodes, payloads}, k, v, p) case 1n+ +f: alloc_read(~K, ~V, ~cmp, 1n+f, p, k, v, read(~K, ~V, ~cmp, TM{n, root, lo, hi, 1n+f, nodes, payloads}, 1n+f)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Cmp 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=Result https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend&name=Rejected 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=alloc_read https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend&name=append https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend&name=read