A.Vector.foldl
You're seeing just the function
foldl
, go back to A.Vector module for more information.
Specs
Folds (reduces) the given vector
from the left with the function fun
.
Requires an accumulator acc
.
Same as reduce/3
.
Runs in linear time.
Examples
iex> A.Vector.new(1..10) |> A.Vector.foldl(0, &+/2)
55
iex> A.Vector.new(1..10) |> A.Vector.foldl([], & [&1 | &2])
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]