import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/io/Fiber/operations/map";
import * as tsplus_module_3 from "@effect/core/io/Fiber/operations/orElse";
/**
 * Returns a fiber that prefers `this` fiber, but falls back to the `that` one
 * when `this` one fails. Interrupting the returned fiber will interrupt both
 * fibers, sequentially, from left to right.
 *
 * @tsplus fluent ets/Fiber orElseEither
 * @tsplus fluent ets/RuntimeFiber orElseEither
 */

export function orElseEither_(self, that) {
  return tsplus_module_3.orElse_(tsplus_module_2.map_(self, tsplus_module_1.left), tsplus_module_2.map_(that(), tsplus_module_1.right));
}
/**
 * Returns a fiber that prefers `this` fiber, but falls back to the `that` one
 * when `this` one fails. Interrupting the returned fiber will interrupt both
 * fibers, sequentially, from left to right.
 *
 * @tsplus static ets/Fiber/Aspects orElseEither
 */

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