KEEP-23 implement group and fold operations
Docs for group-and-fold operations Fix implementation for countEach and sumEachBy countEach and sumEachBy implementations for JS Rename keySelector to keyOf Generate additional sources for groupingBy + headers Rename countEach and sumEachBy to eachCount and eachSumOf.
This commit is contained in:
@@ -587,6 +587,13 @@ public header inline fun <T, K, M : MutableMap<in K, MutableList<T>>> Iterable<T
|
||||
*/
|
||||
public header inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Iterable<T>.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M
|
||||
|
||||
/**
|
||||
* Creates a [Grouping] source from a collection to be used later with one of group-and-fold operations
|
||||
* using the specified [keySelector] function to extract a key from each element.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header inline fun <T, K> Iterable<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
|
||||
|
||||
/**
|
||||
* Returns a list containing the results of applying the given [transform] function
|
||||
* to each element in the original collection.
|
||||
|
||||
Reference in New Issue
Block a user