← Docs
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.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .