import * as tsplus_module_1 from "@effect/core/stm/STM/operations/failNow";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/succeedNow";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Either/fold";
import * as tsplus_module_5 from "@effect/core/stm/STM/operations/foldSTM";
/**
 * Converts a `STM<R, Either<E, B>, A>` into a `STM<R, E, Either<A, B>>`.
 * The inverse of `left`.
 *
 * @tsplus getter ets/STM unleft
 */

export function unleft(self) {
  return tsplus_module_5.foldSTM_(self, either => tsplus_module_4.fold_(either, tsplus_module_1.failNow, b => tsplus_module_3.succeedNow(tsplus_module_2.right(b))), a => tsplus_module_3.succeedNow(tsplus_module_2.left(a)));
}
//# sourceMappingURL=unleft.mjs.map