Hmap.HMap.put.go: def of bend-kit-collections@0.1.4.1 Import: import bend-kit-collections@0.1.4.1/hmap.bend as Hmap Lines 84-108 of bend-kit-collections@0.1.4.1/hmap.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-collections@0.1.4.1/hmap.bend&start_line=84&end_line=108 import Base def HMap.put.go( ~K: Data, ~V: Data, ~eq: K -> K -> Bool, +n: Nat, +mask: U32, m: HMap, +hash: U32, +k: K, +v: V ) -> HMap: match n: case 0n: match m: case HNil{}: HLeaf{hash, [Entry{k, v}]} case HLeaf{oldhash, entries}: HLeaf{oldhash, HMap.entries.put(~K, ~V, ~eq, entries, k, v)} case HBranch{lo, hi}: HBranch{lo, hi} case 1n+p: match m: case HNil{}: HLeaf{hash, [Entry{k, v}]} case HLeaf{+oldhash, +entries}: HMap.bool(HMap, U32.is_eq(oldhash, hash), u => HLeaf{oldhash, HMap.entries.put(~K, ~V, ~eq, entries, k, v)}, u => HMap.split(~K, ~V, ~eq, n, mask, oldhash, entries, hash, k, v)) case HBranch{+lo, +hi}: HMap.bool(HMap, U32.is_eq((hash .&. mask : U32), 0), u => HBranch{HMap.put.go(~K, ~V, ~eq, p, (mask << 1n : U32), lo, hash, k, v), hi}, u => HBranch{lo, HMap.put.go(~K, ~V, ~eq, p, (mask << 1n : U32), hi, hash, k, v)}) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/hmap.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/hmap.bend&name=HMap https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/hmap.bend&name=HMap.bool https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/hmap.bend&name=HMap.entries.put https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/hmap.bend&name=HMap.split