def ins.go
import bend-parallel@0.1.0.0/histogram.bend as Histogramimport Base
182# As col.go, but each entry becomes the sum through it (in place).
183def ins.go(+n: Nat, +at: U32, +step: U32, +s: U32, r: Array<U32> & U32) -> Array<U32>:
184 match n:
185 case 0n:
186 (t, +x) = r
187 t[at] <- (s + x : U32)
188 case 1n+p:
189 (t, +x) = r
190 +v = (s + x : U32)
191 +q = (at + step : U32)
192 ins.go(p, q, step, v, (t[at] <- v)[q])