Scan.ex.go: def of bend-parallel@0.1.0.0 Import: import bend-parallel@0.1.0.0/scan.bend as Scan Lines 51-62 of bend-parallel@0.1.0.0/scan.bend: https://jend.leeeet.dev/read.txt?path=bend-parallel@0.1.0.0/scan.bend&start_line=51&end_line=62 import Base # r holds the array and the entry x read at j: a[j] becomes s, the sum # before it, and so on for the n entries after it. Returns the array and # the running sum past the last entry. def ex.go(+n: Nat, +j: U32, +s: U32, r: Array & U32) -> Array & U32: match n: case 0n: (a, +x) = r (a[j] <- s, (s + x : U32)) case 1n+p: (a, +x) = r +q = (j + 1 : U32) ex.go(p, q, (s + x : U32), (a[j] <- 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