Does anyone know why the Kotlin standard library p...
# stdlib
b
Does anyone know why the Kotlin standard library provides a type-preserving
filter
on
Map<K, out V>
but not
Set<T>
? Writing
set.filter { ... }.toSet()
seems a little repetitive. https://kotlinlang.org/docs/collection-filtering.html#filter-by-predicate
k
I guess one is extension of Map interface and other of Iterable
k
.filterTo
does not help?