Hacker News new | ask | show | jobs
by lenkite 3318 days ago
You now have https://github.com/Kotlin/kotlinx.collections.immutable
1 comments

Cool.

This needs to be built into the language or somehow standardized by the community.

With lack of standardization of immutable collections, there would be lots of different ways that libraries would implement immutability. This would result in losing one of the main benefits of functional programming (i.e. awesome composability).

This is already in the language. It is just an interface which makes the common lists only visible as immutable objects. But inside they are a normal list. And in this case the object is read-only, not immutable, as we were discussing in the other comment thread.
Well, that is part of the Kotlin project itself, so I assume it is or will be built in, should the proposal succeed.
Not sure about the governance model of Kotlin. Hopefully it succeeds.