Hi, I was reading the documentation for
fold function and a question arose.
acc below which is nested in
inline fun <T, R> Array<out T>.fold( initial: R, operation: (acc: R, T) -> R ): R
element below which is is also nested
inline fun <T, K, R> Grouping<T, K>.fold( initialValueSelector: (key: K, element: T) -> R, operation: (key: K, accumulator: R, element: T) -> R ): Map<K, R>
How should I interpret these?
How is this used?
Does this mean that inside function
fold, its parameter
operation, which is a function, should have those exact parameter names, not only following the parameter types?