import * as tsplus_module_1 from "@effect/core/io/Effect/operations/getOrFailDiscard";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/flip";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/mapError";
/**
 * Lifts an `Maybe` into a `IO`. If the option is empty it succeeds with
 * `undefined`. If the option is defined it fails with an error adapted with
 * the specified function.
 *
 * @tsplus static ets/Effect/Ops noneOrFailWith
 */

export function noneOrFailWith(option, f, __tsplusTrace) {
  return tsplus_module_3.mapError_(tsplus_module_2.flip(tsplus_module_1.getOrFailDiscard(option, __tsplusTrace), __tsplusTrace), f, __tsplusTrace);
}
//# sourceMappingURL=noneOrFailWith.mjs.map