def insert_header

bend-collections@1.0.0.0 · src/containers/balanced_search_tree.bend:549

import bend-collections@1.0.0.0/src/containers/balanced_search_tree.bend as BalancedSearchTree
import Base

549def insert_header(~K: Data, ~V: Data, ~cmp: K -> K -> Cmp, m: TreeMap<K, V, cmp>, +id: Nat, +p: Nat, +on_left: Bool) -> TreeMap<K, V, cmp>:
550  TM{+n, root, +lo, +hi, free, nodes, payloads} = m
551  TM{1n+n, root, pick(Nat, Bool.or(Nat.is_eq(n, 0n), Bool.and(on_left, Nat.is_eq(p, lo))), id, lo), pick(Nat, Bool.or(Nat.is_eq(n, 0n), Bool.and(Bool.not(on_left), Nat.is_eq(p, hi))), id, hi), free, nodes, payloads}

Uses (9)

Used by (1)