/** * Statefully maps over the elements of this stream to produce all * intermediate results of type `S` given an initial S. * * @tsplus static effect/core/stream/Stream.Aspects scan * @tsplus pipeable effect/core/stream/Stream scan */ export function scan(s: S, f: (s: S, a: A) => S) { return (self: Stream): Stream => self.scanEffect(s, (s, a) => Effect.sync(f(s, a))) }