Sort.fwd.go: def of bend-parallel@0.1.0.0 Import: import bend-parallel@0.1.0.0/sort.bend as Sort Lines 232-242 of bend-parallel@0.1.0.0/sort.bend: https://jend.leeeet.dev/read.txt?path=bend-parallel@0.1.0.0/sort.bend&start_line=232&end_line=242 import Base # r holds the table and the entry x read at at: it becomes s, and the n # entries after it (each step further on) follow, from s + x. def fwd.go(+n: Nat, +at: U32, +step: U32, +s: U32, r: Array & U32) -> Array: match n: case 0n: (t, +x) = r t[at] <- s case 1n+p: (t, +x) = r +q = (at + step : U32) fwd.go(p, q, step, (s + x : U32), (t[at] <- s)[q]) Uses (8): 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=Array.set 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