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

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