Is there a reason for there not being a `findIndex...
# stdlib
g
Is there a reason for there not being a `findIndexed()`/`firstOrNullIndexed()` method for the
Iterable
class, which takes a
(T) -> Boolean
predicate and returns
IndexedValue<T>
?
o
.indexOfFirst {  }
g
Depends on adding
.takeIf { it >= 0 }?.let { Pair(it, list[it]) }
. Works, though
i
If you need an
IndexedValue
in the end, you can try
.withIndex().find { predicate(it.value) }