Hash.wfold: def of bend-kit-hash@0.3.0.2 Import: import bend-kit-hash@0.3.0.2/hash.bend as Hash Lines 72-81 of bend-kit-hash@0.3.0.2/hash.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-hash@0.3.0.2/hash.bend&start_line=72&end_line=81 import Base # Folds f over n words from word i on. r holds the array and word i. def wfold(~T: Type, ~f: T -> @+c: U32 -> T, n: Nat, r: Array & U32, +i: U32, acc: T) -> Array & T: match n: case 0n: (a, w) = r (a, acc) case 1n+p: (a, +w) = r +j = (i + 1 : U32) wfold(~T, ~f, p, Array.get(U32, a, j), j, f(acc, w)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get 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=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add