import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/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/Maybe/fold";
import * as tsplus_module_5 from "@effect/core/stm/STM/operations/foldSTM";
/**
 * Converts an option on values into an option on errors.
 *
 * @tsplus getter ets/STM some
 */

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