import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Maybe/fold";
/**
 * Continue with the returned computation if the `PartialFunction` matches,
 * translating the successful match into a failure, otherwise continue with
 * our held value.
 *
 * @tsplus fluent ets/Effect rejectEffect
 */

export function rejectEffect_(self, pf, __tsplusTrace) {
  return tsplus_module_3.flatMap_(self, a => tsplus_module_4.fold_(pf(a), () => tsplus_module_1.succeedNow(a, __tsplusTrace), effect => tsplus_module_3.flatMap_(effect, tsplus_module_2.failNow, __tsplusTrace)), __tsplusTrace);
}
/**
 * Continue with the returned computation if the `PartialFunction` matches,
 * translating the successful match into a failure, otherwise continue with
 * our held value.
 *
 * @tsplus static ets/Effect/Aspects rejectEffect
 */

export const rejectEffect = (pf, __tsplusTrace) => self => rejectEffect_(self, pf, __tsplusTrace);
//# sourceMappingURL=rejectEffect.mjs.map