// ets_tracing: off import * as T from "../../../../Effect/index.js" import type * as C from "../core.js" import * as ScanReduceEffect from "./scanReduceEffect.js" /** * Statefully maps over the elements of this stream to produce all intermediate results. * * See also `Stream#scan`. */ export function scanReduce_( self: C.Stream, f: (a1: A1, a: A) => A1 ): C.Stream { return ScanReduceEffect.scanReduceEffect_(self, (curr, next) => T.succeed(f(curr, next)) ) } /** * Statefully maps over the elements of this stream to produce all intermediate results. * * See also `Stream#scan`. * * @ets_data_first scanReduce_ */ export function scanReduce(f: (a1: A1, a: A) => A1) { return (self: C.Stream) => scanReduce_(self, f) }