Fold (higher-order function): Difference between revisions

Content deleted Content added
Xashm (talk | contribs)
WikiCleanerBot (talk | contribs)
m v2.03b - Bot T20 CW#61 - WP:WCW project (Reference before punctuation)
Line 324:
|''<code>Iterable</code>''<code>.reduceRight''(func'')</code>
|
|Other collections also support <code>fold</code><ref>{{cite web |title=fold - Kotlin Programming Language |url=https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/fold.html |website=Kotlin |publisher=Jetbrains |accessdate=29 March 2019 |ref=fold.kt}}</ref> and <code>reduce</code>.<ref>{{cite web |title=reduce - Kotlin Programming Language |url=https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/reduce.html |website=Kotlin |publisher=Jetbrains |accessdate=29 March 2019 |ref=reduce.kt}}</ref>. There is also <code>Result.fold(onSuccess, onFailure)</code>,<ref>{{cite web |title=Result - Kotlin Programming Language |url=https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/index.html |website=Kotlin |publisher=Jetbrains |accessdate=29 March 2019 |ref=Result.kt}}</ref>, which reduces a <code>Result<T></code> (either success or failure) to the return type of <code>onSuccess</code> and <code>onFailure</code>.
|- valign="top"
| [[LFE (programming language)|LFE]]