import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/fail";
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";
/**
 * "Zooms in" on the value in the `Right` side of an `Either`, moving the
 * possibility that the value is a `Left` to the error channel.
 *
 * @tsplus getter ets/STM right
 */

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