singleOrNone

Returns single element as Some, or None if the iterable is empty or has more than one element.


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

Returns the single element as Some matching the given predicate, or None if element was not found or more than one element was found.