import * as tsplus_module_1 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/flatMap";
/**
 * Fail with `e` if the supplied `PartialFunction` does not match, otherwise
 * continue with the returned value.
 *
 * @tsplus fluent ets/Effect continueOrFailEffect
 */

export function continueOrFailEffect_(self, e, pf, __tsplusTrace) {
  return tsplus_module_3.flatMap_(self, v => tsplus_module_2.getOrElse_(pf(v), () => tsplus_module_1.fail(e, __tsplusTrace)), __tsplusTrace);
}
/**
 * Fail with `e` if the supplied `PartialFunction` does not match, otherwise
 * continue with the returned value.
 *
 * @tsplus static ets/Effect/Aspects continueOrFailEffect
 */

export const continueOrFailEffect = (e, pf, __tsplusTrace) => self => continueOrFailEffect_(self, e, pf, __tsplusTrace);
//# sourceMappingURL=continueOrFailEffect.mjs.map