/** * Maps each element to an Collection, and flattens the Collections into the * output of this stream. * * @tsplus static effect/core/stream/Stream.Aspects mapConcat * @tsplus pipeable effect/core/stream/Stream mapConcat */ export function mapConcat( f: (a: A) => Collection ) { return (self: Stream): Stream => self.chunksWith((chunk) => chunk.map((chunk) => chunk.flatMap((a) => Chunk.from(f(a))))) }