def weight_balanced

bend-kit-collections@0.1.4.1 · LAWS.bend:267

import bend-kit-collections@0.1.4.1/LAWS.bend as LAWS
import Base
import bend-kit-collections@0.1.4.1/omap.bend as O

267def weight_balanced(-K: Data, -V: Data, m: O.OMap<K, V>) -> Bool:
268  match m:
269    case O.OTip{}:
270      True{}
271    case O.OBin{s, k, v, +lo, +hi}:
272      weight_ok(omap_weight(K, V, lo), omap_weight(K, V, hi))
273        && weight_balanced(K, V, lo) && weight_balanced(K, V, hi)

Uses (5)

Used by (4)