Implement EffectGuard<T>, which only applies an effect if a predicate is true.