import { concreteStream, StreamInternal } from "@effect/core/stream/Stream/operations/_internal/StreamInternal" /** * Provides a layer to the stream, which translates it to another level. * * @tsplus static effect/core/stream/Stream.Aspects provideLayer * @tsplus pipeable effect/core/stream/Stream provideLayer */ export function provideLayer(layer: Layer) { return (self: Stream): Stream => { concreteStream(self) return new StreamInternal( Channel.unwrapScoped(layer.build.map((env) => self.channel.provideEnvironment(env))) ) } }