def col.go

bend-parallel@0.1.0.0 · histogram.bend:170

import bend-parallel@0.1.0.0/histogram.bend as Histogram
import Base

170# r holds the table and the entry x read at at: adds x and the n entries
171# after it, each step further on, to s.
172def col.go(+n: Nat, +at: U32, +step: U32, +s: U32, r: Array<U32> & U32) -> Array<U32> & U32:
173  match n:
174    case 0n:
175      (t, +x) = r
176      (t, (s + x : U32))
177    case 1n+p:
178      (t, +x) = r
179      +q = (at + step : U32)
180      col.go(p, q, step, (s + x : U32), t[q])

Uses (7)

Used by (3)