def indexed_step
import stelliferous@0.0.2.0/traversal_array.bend as TraversalArrayimport Base
15# Indexed state updates share the traversal counter without requiring an array
16# destination. The caller establishes any no-wrap bound on the U32 position.
17def indexed_step(~Value: Type,~Context: Data,~update: U32 -> Context -> Value -> Value,
18 state: State<&2,&1,Unit,Value,Context>) -> State<&2,&1,Unit,Value,Context>:
19 State{Unit{},value,+position,+context} = state
20 State{Unit{},update(position,context,value),(position + 1 : U32),context}