import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeedNone";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/asSome";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/suspendSucceed";
/**
 * The moral equivalent of `if (!p) exp` when `p` has side-effects.
 *
 * @tsplus fluent ets/Effect unlessEffect
 */

export function unlessEffect_(self, predicate, __tsplusTrace) {
  return tsplus_module_4.suspendSucceed(() => tsplus_module_3.flatMap_(predicate(), b => b ? tsplus_module_1.succeedNone : tsplus_module_2.asSome(self, __tsplusTrace), __tsplusTrace), __tsplusTrace);
}
/**
 * The moral equivalent of `if (!p) exp` when `p` has side-effects.
 *
 * @tsplus static ets/Effect/Aspects unlessEffect
 */

export const unlessEffect = (predicate, __tsplusTrace) => self => unlessEffect_(self, predicate, __tsplusTrace);
//# sourceMappingURL=unlessEffect.mjs.map