import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/failNow";
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<B, E>, A>` into a `STM<R, E, Either<B, A>>`.
 * The inverse of `right`.
 *
 * @tsplus getter ets/STM unright
 */

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