kotlin-stdlib / kotlin.coroutines / CoroutineContext / Element / fold fold Common JVM JS Native 1.0 open fun <R> fold( initial: R, operation: (R, Element) -> R): R(source) Accumulates entries of this context starting with initial value and applying operation from left to right to current accumulator value and each element of this context.