4 ms·
Persistent collections for Kotlin are actually implemented in a first-party library: https://github.com/Kotlin/kotlinx.collections.immutable https://github.com/
by moritzruth 2y ago
Persistent collections for Kotlin are actually implemented in a first-party library: https://github.com/Kotlin/kotlinx.collections.immutable https://github.com/Kotlin/kotlinx.collections.immutable
I use it in almost every project because it works so well with StateFlow: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/ https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-corout...
- ragnese 2y agoThat's not what I would call a "first-party" library. Yes, it's written by JetBrains and under the Kotlin project umbrella, but we have to add it to our project like any other dependency. I can install a persistent collections library in any language. I know for a fact there are persistent collections libraries for Rust, JavaScript, Java, etc. But since none of those are built-in, they aren't used by the standard library APIs, and they won't be used throughout the wider ecosystem. And, I'm still not willing to call Java a "functional language" because I can install a third-party library for persistent/immutable collections and hopefully avoid the built-in collections as much as possible.