someIf

inline fun <T> someIf(predicate: Boolean, provider: () -> T): Option<T>(source)

Factory method to create an Option.

Return

Some wrapping the value given by the provider if the predicate holds, None otherwise.