/** * Reduces the elements in the stream to a value of type `S`. Stops the fold * early when the condition is not fulfilled. * * @tsplus static effect/core/stream/Stream.Aspects runFoldWhileEffect * @tsplus pipeable effect/core/stream/Stream runFoldWhileEffect */ export function runFoldWhileEffect( s: S, cont: Predicate, f: (s: S, a: A) => Effect ) { return (self: Stream): Effect => Effect.scoped(self.runFoldWhileScopedEffect(s, cont, f)) }