Std\FloatArray
Contiguous unboxed array of Float (64-bit double) values. No per-element
reference counting. O(1) random access, cache-friendly iteration.
Functions
Section titled “Functions”alloc : Int -> FloatArrayAllocate an uninitialized FloatArray with the given number of elements.
fill : Int -> Float -> FloatArrayCreate a FloatArray of n elements, all set to the given value.
import fill from Std\FloatArray infill 1000 0.0 -- 1000 zeroslength
Section titled “length”length : FloatArray -> IntO(1) element count.
get : FloatArray -> Int -> FloatO(1) indexed access.
set : FloatArray -> Int -> Float -> FloatArrayPersistent set — returns a new array with the element replaced.
head : FloatArray -> FloatFirst element. O(1).
tail : FloatArray -> FloatArrayAll elements except the first.
cons : Float -> FloatArray -> FloatArrayPrepend an element.
join : FloatArray -> FloatArray -> FloatArrayConcatenate two arrays.
map : (Float -> Float) -> FloatArray -> FloatArrayApply a function to each element. SIMD-eligible for simple operations.
foldl : (Float -> Float -> Float) -> Float -> FloatArray -> FloatLeft fold over all elements.
import fill, foldl from Std\FloatArray infoldl (\acc x -> acc + x) 0.0 (fill 100 1.5) -- 150.0