// tracing: off
import * as O from "../Option"
import { succeed } from "./core"
import { foldM_ } from "./foldM"
/**
 * Converts an option on errors into an option on values.
 */

export function option(self, __trace) {
  return foldM_(
    self,
    () => succeed(O.none),
    (a) => succeed(O.some(a)),
    __trace
  )
}
//# sourceMappingURL=option.js.map
