def indexed_step

stelliferous@0.0.2.0 · traversal_array.bend:15

import stelliferous@0.0.2.0/traversal_array.bend as TraversalArray
import 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}

Uses (4)

Used by (1)