import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/map";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/suspendSucceed";
/**
 * The moral equivalent of `if (p) exp`.
 *
 * @tsplus static ets/Effect/Ops when
 */

export function when(predicate, effect, __tsplusTrace) {
  return tsplus_module_4.suspendSucceed(() => predicate() ? tsplus_module_2.map_(effect, tsplus_module_1.some, __tsplusTrace) : tsplus_module_3.succeedNow(tsplus_module_1.none, __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=when.mjs.map