// tracing: off
import { chain_, succeed, suspend } from "./core"
/**
 * Run conditionally onTrue or onFalse
 *
 * @dataFirst ifM_
 */

export function ifM(onTrue, onFalse, __trace) {
  return (b) => ifM_(b, onTrue, onFalse, __trace)
}
/**
 * Run conditionally onTrue or onFalse
 */

export function ifM_(b, onTrue, onFalse, __trace) {
  return chain_(b, (x) => (x ? suspend(onTrue, __trace) : suspend(onFalse, __trace)))
}
/**
 * Run conditionally onTrue or onFalse
 *
 * @dataFirst if_
 */

function _if(onTrue, onFalse, __trace) {
  return (b) => if_(b, onTrue, onFalse, __trace)
}
/**
 * Run conditionally onTrue or onFalse
 */

export function if_(b, onTrue, onFalse, __trace) {
  return ifM_(succeed(b), onTrue, onFalse, __trace)
}
export { _if as if }
//# sourceMappingURL=ifM.js.map
