/** * The moral equivalent of `if (p) exp`. * * @tsplus static effect/core/io/Effect.Ops when */ export function when( predicate: LazyArg, effect: Effect ): Effect> { return Effect.suspendSucceed( predicate() ? effect.map(Maybe.some) : Effect.succeed(Maybe.none) ) }