import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/stream/Stream/operations/map";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/orElse";
/**
 * Switches to the provided stream in case this one fails with a typed error.
 *
 * See also `Stream.catchAll`.
 *
 * @tsplus fluent ets/Stream orElseEither
 */

export function orElseEither_(self, that, __tsplusTrace) {
  return tsplus_module_3.orElse_(tsplus_module_2.map_(self, tsplus_module_1.left, __tsplusTrace), () => tsplus_module_2.map_(that(), tsplus_module_1.right, __tsplusTrace), __tsplusTrace);
}
/**
 * Switches to the provided stream in case this one fails with a typed error.
 *
 * See also `Stream.catchAll`.
 *
 * @tsplus static ets/Stream/Aspects orElseEither
 */

export const orElseEither = (that, __tsplusTrace) => self => orElseEither_(self, that, __tsplusTrace);
//# sourceMappingURL=orElseEither.mjs.map