"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.if = exports.if_ = exports.ifM_ = exports.ifM = void 0;
// ets_tracing: off
const core_1 = require("./core");
/**
 * Run conditionally onTrue or onFalse
 *
 * @ets_data_first ifM_
 */
function ifM(onTrue, onFalse, __trace) {
    return (b) => ifM_(b, onTrue, onFalse, __trace);
}
exports.ifM = ifM;
/**
 * Run conditionally onTrue or onFalse
 */
function ifM_(b, onTrue, onFalse, __trace) {
    return (0, core_1.chain_)(b, (x) => x ? (0, core_1.suspend)(onTrue, __trace) : (0, core_1.suspend)(onFalse, __trace));
}
exports.ifM_ = ifM_;
/**
 * Run conditionally onTrue or onFalse
 *
 * @ets_data_first if_
 */
function _if(onTrue, onFalse, __trace) {
    return (b) => if_(b, onTrue, onFalse, __trace);
}
exports.if = _if;
/**
 * Run conditionally onTrue or onFalse
 */
function if_(b, onTrue, onFalse, __trace) {
    return ifM_((0, core_1.succeed)(b), onTrue, onFalse, __trace);
}
exports.if_ = if_;
//# sourceMappingURL=ifM.js.map