import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/map";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/tryOrElse";
/**
 * Returns an effect that will produce the value of this effect, unless it
 * fails, in which case, it will produce the value of the specified effect.
 *
 * @tsplus fluent ets/Effect orElseEither
 */

export function orElseEither_(self, that, __tsplusTrace) {
  return tsplus_module_4.tryOrElse_(self, () => tsplus_module_2.map_(that(), tsplus_module_1.right, __tsplusTrace), a => tsplus_module_3.succeedNow(tsplus_module_1.left(a), __tsplusTrace), __tsplusTrace);
}
/**
 * Returns an effect that will produce the value of this effect, unless it
 * fails, in which case, it will produce the value of the specified effect.
 *
 * @tsplus static ets/Effect/Aspects orElseEither
 */

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