/** * Executes an effectful fold over the stream of values. Returns a scoped * value that represents the scope of the stream. Stops the fold early when * the condition is not fulfilled. * * @param cont A function which defines the early termination condition. * * @tsplus static effect/core/stream/Stream.Aspects runFoldWhileScopedEffect * @tsplus pipeable effect/core/stream/Stream runFoldWhileScopedEffect */ export function runFoldWhileScopedEffect( s: S, cont: Predicate, f: (s: S, a: A) => Effect ) { return (self: Stream): Effect => self.runScoped( Sink.foldEffect(s, cont, f) ) }