Scan.puts: def of bend-parallel@0.1.0.0 Import: import bend-parallel@0.1.0.0/scan.bend as Scan Lines 146-160 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=146&end_line=160 import Base # Pass 3's forks, shaped as pass 1's. Leaf i reads s[i] and reads and # writes only its block of a: no two lanes touch one slot. def puts(+inc: Bool, +d: Nat, +i: U32, +e: Nat, fa: Array & Array, fs: Array & Array) -> Two: match d: case 0n: (a, a2) = fa (s, s2) = fs two.rejoin(a2, s2, puts.leaf(inc, i, e, a, s)) case 1n+p: (a0, a1) = fa (s0, s1) = fs +j = (i * 2 : U32) l r = puts(inc, p, j, e, Array.fork(U32, a0), Array.fork(U32, s0)) puts(inc, p, (j + 1 : U32), e, Array.fork(U32, a1), Array.fork(U32, s1)) two.join(l, r) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.fork https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/scan.bend&name=Two https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/scan.bend&name=puts.leaf https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/scan.bend&name=two.join https://jend.leeeet.dev/definition.txt?path=bend-parallel@0.1.0.0/scan.bend&name=two.rejoin