def map_when

stelliferous@0.0.2.0 · traversal_lanes.bend:96

import stelliferous@0.0.2.0/traversal_lanes.bend as TraversalLanes
import Base
import stelliferous@0.0.2.0/traversal_array.bend as Traversal

96# map over count values from position when the array is known to hold them,
97# and the scalar map otherwise: the same array either way.
98def map_when(~Context: Data,~operation: Context -> F32 -> F32,covered: Bool,count: Nat,position: U32,context: Context,values: Array<F32>) -> Array<F32>:
99  match covered:
100    case True{}: map(~Context,~operation,count,position,context,values)
101    case False{}: Traversal.map_in_place(~F32,~Context,~operation,count,position,context,values)

Uses (7)

Used by (6)