import * as tracing_1 from "../Tracing";
const fileName_1 = "(@effect-ts/system): _src/Effect/unoption.ts";
import * as O from "../Option";
import { succeed } from "./core";
import { fail } from "./fail";
import * as FM from "./foldM";
/**
 * Converts an option on errors into an option on values.
 */

export function unoption(self) {
  return FM.foldM_(self, O.fold(() => succeed(O.none, fileName_1 + ":14:20"), _ => fail(_, fileName_1 + ":15:18")), a => succeed(O.some(a), fileName_1 + ":17:19"), fileName_1 + ":11:19");
}
//# sourceMappingURL=unoption.js.map