import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeed";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/suspendSucceed";
/**
 * Evaluate the predicate, return the given `A` as success if predicate returns
 * true, and the given `E` as error otherwise
 *
 * For effectful conditionals, see `ifEffect`.
 *
 * @tsplus static ets/Effect/Ops cond
 */

export function cond(predicate, result, error, __tsplusTrace) {
  return tsplus_module_3.suspendSucceed(() => predicate() ? tsplus_module_1.succeed(result, __tsplusTrace) : tsplus_module_2.fail(error, __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=cond.mjs.map