gjesse
01/03/2017, 1:52 AMfun <A,B: Any> Iterable<A>.firstNotNull(process: (A) -> B?) : B? {
return this.asSequence().firstNotNull(process)
}
fun <A,B: Any> Sequence<A>.firstNotNull(process: (A) -> B?) : B? {
return this.mapNotNull {
process(it)
}
.firstOrNull()
}