import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Maybe/fold";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/foldEffect";
/**
 * Converts an option on errors into an option on values.
 *
 * @tsplus fluent ets/Effect unsome
 */

export function unsome(self, __tsplusTrace) {
  return tsplus_module_5.foldEffect_(self, option => tsplus_module_4.fold_(option, () => tsplus_module_2.succeedNow(tsplus_module_1.none, __tsplusTrace), tsplus_module_3.failNow), a => tsplus_module_2.succeedNow(tsplus_module_1.some(a), __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=unsome.mjs.map