Report.count_loop: def of bend-visgraph@2.0.0.0 Import: import bend-visgraph@2.0.0.0/src/report.bend as Report Lines 63-72 of bend-visgraph@2.0.0.0/src/report.bend: https://jend.leeeet.dev/read.txt?path=bend-visgraph@2.0.0.0/src/report.bend&start_line=63&end_line=72 import Base # How many nodes have each degree: `r` is the degree array with the degree # of node `i`; the `f` nodes above `i` are still to count. def count_loop(f: Nat, r: Array & U32, +i: U32, c: Array) -> Array: match f: case 0n: (d, v) = r bump(c, v) case 1n+q: (d, v) = r count_loop(q, Array.get(U32, d, (i + 1 : U32)), (i + 1 : U32), bump(c, v)) 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=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=bend-visgraph@2.0.0.0/src/report.bend&name=bump