/** * Runs this sink until it yields a result, then uses that result to create * another sink from the provided function which will continue to run until it * yields a result. * * This function essentially runs sinks in sequence. * * @tsplus static effect/core/stream/Sink.Aspects flatMap * @tsplus pipeable effect/core/stream/Sink flatMap */ export function flatMap( f: (z: Z) => Sink ) { return (self: Sink): Sink => self.foldSink((e) => Sink.fail(e), f) }