// ets_tracing: off import * as T from "../../../../Effect/index.js" import type { Predicate } from "../../../../Function/index.js" import * as M from "../../../../Managed/index.js" import type * as C from "../core.js" import * as RunReduceWhileManagedEffect from "./runReduceWhileManagedEffect.js" /** * Executes an effectful fold over the stream of values. * Stops the fold early when the condition is not fulfilled. */ export function runReduceWhileEffect_( self: C.Stream, s: S, cont: Predicate, f: (s: S, a: A) => T.Effect ): T.Effect { return M.use_( RunReduceWhileManagedEffect.runReduceWhileManagedEffect_(self, s, cont, f), T.succeed ) } /** * Executes an effectful fold over the stream of values. * Stops the fold early when the condition is not fulfilled. * * @ets_data_first runReduceWhileEffect_ */ export function runReduceWhileEffect( s: S, cont: Predicate, f: (s: S, a: A) => T.Effect ) { return (self: C.Stream) => runReduceWhileEffect_(self, s, cont, f) }