import { concreteStream, StreamInternal } from "@effect/core/stream/Stream/operations/_internal/StreamInternal" /** * Switches to the provided stream in case this one fails with a typed error. * * See also `Stream.catchAll`. * * @tsplus pipeable-operator effect/core/stream/Stream | * @tsplus static effect/core/stream/Stream.Aspects orElse * @tsplus pipeable effect/core/stream/Stream orElse */ export function orElse( that: LazyArg> ) { return (self: Stream): Stream => { concreteStream(self) return new StreamInternal( self.channel.orElse(() => { const that0 = that() concreteStream(that0) return that0.channel }) ) } }