CLOVIS
03/11/2026, 2:33 PMfun <T, R> Pair<Iterable<T>, Iterable<T>>.mapEach(transform: (T) -> R): Pair<Iterable<R>, Iterable<R>> {
val (left, right) = this
return left.map(transform) to right.map(transform)
}
The use-case would be mapping after a call to .partition :
…
.partition { it.isSuccessful }
.mapEach { it.id }
I find that it's something I do relatively oftenCLOVIS
03/11/2026, 3:18 PMfirst and second , but yeah that's the same functionCLOVIS
03/11/2026, 3:19 PMCLOVIS
03/11/2026, 3:19 PM