Sort.xs.go: def of bend-parallel@0.1.0.0 Import: import bend-parallel@0.1.0.0/sort.bend as Sort Lines 86-97 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=86&end_line=97 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. Returns the # table and the sum past the last. def xs.go(+n: Nat, +at: U32, +step: U32, +s: U32, r: Array & U32) -> Array & U32: match n: case 0n: (t, +x) = r (t[at] <- s, (s + x : U32)) case 1n+p: (t, +x) = r +q = (at + step : U32) xs.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