import type * as Arr from "../Array.ts" import type * as Channel from "../Channel.ts" import { identity } from "../Function.ts" import { pipeArguments } from "../Pipeable.ts" import type { Stream } from "../Stream.ts" const TypeId = "~effect/Stream" const streamVariance = { _R: identity, _E: identity, _A: identity } const StreamProto = { [TypeId]: streamVariance, pipe() { return pipeArguments(this, arguments) } } /** @internal */ export const fromChannel = , E, R>( channel: Channel.Channel ): Stream ? A : never, E, R> => { const self = Object.create(StreamProto) self.channel = channel return self }