Hmap.HMap.split: def of bend-kit-collections@0.1.4.1 Import: import bend-kit-collections@0.1.4.1/hmap.bend as Hmap Lines 68-82 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=68&end_line=82 import Base def HMap.split( ~K: Data, ~V: Data, ~eq: K -> K -> Bool, +n: Nat, +mask: U32, +oldhash: U32, +entries: List<&2, Entry>, +hash: U32, +k: K, +v: V ) -> HMap: match n: case 0n: HLeaf{oldhash, HMap.entries.put(~K, ~V, ~eq, entries, k, v)} case 1n+p: HMap.bool(HMap, U32.is_eq((oldhash .&. mask : U32), (hash .&. mask : U32)), u => HMap.bool(HMap, U32.is_eq((oldhash .&. mask : U32), 0), x => HBranch{HMap.split(~K, ~V, ~eq, p, (mask << 1n : U32), oldhash, entries, hash, k, v), HNil{}}, x => HBranch{HNil{}, HMap.split(~K, ~V, ~eq, p, (mask << 1n : U32), oldhash, entries, hash, k, v)}), u => HMap.split.side(K, V, U32.is_eq((oldhash .&. mask : U32), 0), HLeaf{oldhash, entries}, HLeaf{hash, [Entry{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.side