import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Either/fold";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/foldEffect";
/**
 * "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/Effect right
 */

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