// ets_tracing: off
import * as C from "../../Cause";
import * as E from "../../Either";
import { catchAllCause_ } from "./catchAllCause";
import { halt } from "./halt";
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with a typed error.
 */

export function catchAll_(self, f) {
  return catchAllCause_(self, c => E.fold_(C.failureOrCause(c), f, halt));
}
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with a typed error.
 */

export function catchAll(f) {
  return self => catchAll_(self, f);
}
//# sourceMappingURL=catchAll.js.map