TraversalLanes.map_when: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/traversal_lanes.bend as TraversalLanes Lines 96-101 of stelliferous@0.0.2.0/traversal_lanes.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/traversal_lanes.bend&start_line=96&end_line=101 import Base import stelliferous@0.0.2.0/traversal_array.bend as Traversal # map over count values from position when the array is known to hold them, # and the scalar map otherwise: the same array either way. def map_when(~Context: Data,~operation: Context -> F32 -> F32,covered: Bool,count: Nat,position: U32,context: Context,values: Array) -> Array: match covered: case True{}: map(~Context,~operation,count,position,context,values) case False{}: Traversal.map_in_place(~F32,~Context,~operation,count,position,context,values) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=map_in_place https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_lanes.bend&name=map