def mapped_value

stelliferous@0.0.2.0 · traversal_array.bend:104

import stelliferous@0.0.2.0/traversal_array.bend as TraversalArray
import Base

104# Reuse the output owner for each read/write; no second array or clone.
105def mapped_value(~Element: Data,~Context: Data,~map: Context -> Element -> Element,
106  +position: U32,+context: Context,result: Array<Element> & Element) -> State<&2,&1,Unit,Array<Element>,Context>:
107  (output,value) = result
108  State{Unit{},Array.set(Element,output,position,map(context,value)),(position + 1 : U32),context}

Uses (8)

Used by (3)