import * as tsplus_module_1 from "@effect/core/io/Cause/errors";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Either/definition";
/**
 * Converts the `Exit` to an `Either<FiberFailure<E>, A>`, by wrapping the
 * cause in `FiberFailure` (if the result is failed).
 *
 * @tsplus getter ets/Exit toEither
 */

export function toEither(self) {
  switch (self._tag) {
    case "Failure":
      return tsplus_module_2.left(new tsplus_module_1.FiberFailure(self.cause));

    case "Success":
      return tsplus_module_2.right(self.value);
  }
}
//# sourceMappingURL=toEither.mjs.map