function scan (f, initial, stream) {
  return new Stream(new Scan(f, initial, stream.source))
}
Create a stream containing successive reduce results of applying f to
the previous reduce result and the current stream item.
@param {function(result:*, x:*):*} f reducer function
@param {*} initial initial value
@param {Stream} stream stream to scan
@returns {Stream} new stream containing successive reduce results