Visgraph.starts: def of bend-visgraph@2.0.0.0 Import: import bend-visgraph@2.0.0.0/visgraph.bend as Visgraph Lines 910-920 of bend-visgraph@2.0.0.0/visgraph.bend: https://jend.leeeet.dev/read.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&start_line=910&end_line=920 import Base # The counts of `n` nodes, in place, as where each node's run starts; slot # `n` gets the total. def starts(count: Nat, +i: U32, r: Array & U32, +acc: U32) -> Array: match count: case 0n: (a, c) = r Array.set(U32, a, i, acc) case 1n+k: (a, +c) = r +i2 = (i + 1 : U32) starts(k, i2, Array.get(U32, Array.set(U32, a, i, acc), i2), (acc + c : U32)) 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