Enum.scan
You're seeing just the function
scan
, go back to Enum module for more information.
Specs
Applies the given function to each element in the enumerable
,
storing the result in a list and passing it as the accumulator
for the next computation. Uses the first element in the enumerable
as the starting value.
Examples
iex> Enum.scan(1..5, &(&1 + &2))
[1, 3, 6, 10, 15]
Specs
Applies the given function to each element in the enumerable
,
storing the result in a list and passing it as the accumulator
for the next computation. Uses the given acc
as the starting value.
Examples
iex> Enum.scan(1..5, 0, &(&1 + &2))
[1, 3, 6, 10, 15]