firstOrNone

fun <T> Iterable<T>.firstOrNone(): Option<T>

Returns the first element as Some(element), or None if the iterable is empty.


inline fun <T> Iterable<T>.firstOrNone(predicate: (T) -> Boolean): Option<T>

Returns the first element as Some(element) matching the given predicate, or None if element was not found.