A.Vector.foldl

You're seeing just the function foldl, go back to A.Vector module for more information.

Specs

foldl(t(val), acc, (val, acc -> acc)) :: acc when val: value(), acc: term()

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]