def run_acc

bend-collections@1.0.0.0 · src/containers/dynamic_array.bend:282

import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as DynamicArray
import Base
import bend-collections@1.0.0.0/src/containers/types/dynamic_array.bend as E

282# Runs ops left to right; observations are accumulated newest-first.
283def run_acc(-T: Data, ops: List<&2, E.Op<T>>, st: DynArray<&2, T> & List<&2, E.Obs<T>>) -> DynArray<&2, T> & List<&2, E.Obs<T>>:
284  match ops:
285    case Nil{}:
286      st
287    case Con{op, rest}:
288      run_acc(T, rest, step_acc(T, op, st))

Uses (6)

Used by (1)