import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/map";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/orElse";
/**
 * Returns a transactional effect that will produce the value of this effect
 * in left side, unless it fails or retries, in which case, it will produce
 * the value of the specified effect in right side.
 *
 * @tsplus fluent ets/STM 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 transactional effect that will produce the value of this effect
 * in left side, unless it fails or retries, in which case, it will produce
 * the value of the specified effect in right side.
 *
 * @tsplus static ets/STM/Aspects orElseEither
 */

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