import { concreteStream, StreamInternal } from "@effect/core/stream/Stream/operations/_internal/StreamInternal" /** * Performs a filter and map in a single step. * * @tsplus static effect/core/stream/Stream.Aspects collect * @tsplus pipeable effect/core/stream/Stream collect */ export function collect(pf: (a: A) => Maybe) { return (self: Stream): Stream => { concreteStream(self) return new StreamInternal(self.channel.mapOut((chunk) => chunk.collect(pf))) } }