// ets_tracing: off
import * as O from "../Option";
import { succeed } from "./core";
import { map_ } from "./map";
/**
 * The moral equivalent of `if (p) exp`
 */

export function when_(self, predicate, __trace) {
  return predicate() ? map_(self, O.some, __trace) : succeed(O.none, __trace);
}
/**
 * The moral equivalent of `if (p) exp`
 *
 * @ets_data_first when_
 */

export function when(predicate, __trace) {
  return self => when_(self, predicate, __trace);
}
//# sourceMappingURL=when.js.map