Stream.scan/2

defmodule Stream do
  def scan(stream, fun)
end

Creates a stream that applies the given function to each element, emits the result and uses the same result as the accumulator for the next computation. Uses the first element in the enumerable as the starting value.