Enum.scan/3
defmodule Enum do
def scan(enumerable, acc, 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 given acc
as the starting value.