Stream.scan/3

defmodule Stream do
  def scan(stream, acc, 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 given acc as the starting value.