Enum.scan/2
defmodule Enum do
def scan(enumerable, fun)
end
Applies the function fun
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.