This function is provided as a more efficient runtime alternative to (l.map f).toArray
.
(It avoids the intermediate memory allocation of creating an intermediate list first.)
For verification purposes, we immediately simplify it to that form.
Equations
- l.toArrayMap f = List.foldl (fun (acc : Array β) (x : α) => acc.push (f x)) #[] l