"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.if = exports.if_ = exports.ifM_ = exports.ifM = void 0
// tracing: off
const core_1 = require("../core")
const succeed_1 = require("../succeed")
/**
 * Conditional logic
 *
 * @dataFirst ifM_
 */
function ifM(onTrue, onFalse, __trace) {
  return (b) => ifM_(b, onTrue, onFalse, __trace)
}
exports.ifM = ifM
/**
 * Conditional logic
 */
function ifM_(b, onTrue, onFalse, __trace) {
  return (0, core_1.chain_)(b, (x) => (x ? onTrue() : onFalse()), __trace)
}
exports.ifM_ = ifM_
/**
 * Conditional logic
 *
 * @dataFirst if_
 */
function _if(onTrue, onFalse) {
  return (b) => if_(b, onTrue, onFalse)
}
exports.if = _if
/**
 * Conditional logic
 */
function if_(b, onTrue, onFalse, __trace) {
  return ifM_((0, succeed_1.succeed)(b), onTrue, onFalse, __trace)
}
exports.if_ = if_
//# sourceMappingURL=ifM.js.map
