tock / ai.tock.shared / kotlin.collections.Iterable

Extensions for kotlin.collections.Iterable

mapNotNullValues

Map not null values of the Pair results of the specified transformation.

fun <T, K, V> Iterable<T>.mapNotNullValues(transform: (T) -> Pair<K, V?>): List<Pair<K, V>>

sumByLong

Returns the sum of all values produced by selector function applied to each element in the collection.

fun <T> Iterable<T>.sumByLong(selector: (T) -> Long): Long