import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/catchAllCause";
import { concreteStream, StreamInternal } from "@effect/core/stream/Stream/operations/_internal/StreamInternal";
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails. Allows recovery from all causes of failure, including
 * interruption if the stream is uninterruptible.
 *
 * @tsplus fluent ets/Stream catchAllCause
 */

export function catchAllCause_(self, f, __tsplusTrace) {
  void 0;
  return new StreamInternal(tsplus_module_1.catchAllCause_(self.channel, cause => {
    const stream = f(cause);
    void 0;
    return stream.channel;
  }));
}
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails. Allows recovery from all causes of failure, including
 * interruption if the stream is uninterruptible.
 *
 * @tsplus static ets/Stream/Aspects catchAllCause
 */

export const catchAllCause = (f, __tsplusTrace) => self => catchAllCause_(self, f, __tsplusTrace);
//# sourceMappingURL=catchAllCause.mjs.map