// ets_tracing: off import type * as T from "../../../../Effect/index.js" import type { Predicate } from "../../../../Function/index.js" import type * as M from "../../../../Managed/index.js" import * as SK from "../../Sink/index.js" import type * as C from "../core.js" import * as RunManaged from "./runManaged.js" /** * Executes an effectful fold over the stream of values. * Returns a Managed value that represents the scope of the stream. * Stops the fold early when the condition is not fulfilled. */ export function runReduceWhileManagedEffect_( self: C.Stream, s: S, cont: Predicate, f: (s: S, a: A) => T.Effect ): M.Managed { return RunManaged.runManaged_(self, SK.reduceEffect(s, cont, f)) } /** * Executes an effectful fold over the stream of values. * Returns a Managed value that represents the scope of the stream. * Stops the fold early when the condition is not fulfilled. */ export function runReduceWhileManagedEffect( s: S, cont: Predicate, f: (s: S, a: A) => T.Effect ) { return (self: C.Stream) => runReduceWhileManagedEffect_(self, s, cont, f) }