Comparing the pages for both methods scan
and runningFold
(from kotlin.collections
), the two appear to be identical save for the name.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/scan.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/running-fold.html
Apparently there is no difference, check this out:
runningFold() and runningReduce() are introduced as synonyms for scan() and scanReduce(). Such names are more consistent with the related functions fold() and reduce(). In the future, scan() will be available along with runningFold() since it’s a commonly known name for this operation. The experimental scanReduce(), however, will be deprecated and removed soon.
source: https://blog.jetbrains.com/kotlin/2020/05/1-4-m2-standard-library/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With