kotlinx.collections.immutable
kotlinx.collections.immutable copied to clipboard
Add `buildPersistentList { }`, `buildPersistentMap { }`, `buildPersistentSet { }` to match the builders in kotlin stdlib
trafficstars
Add buildPersistentList { }, buildPersistentMap { }, buildPersistentSet { } to match the collection builders in kotlin stdlib
I would imagine it would look something like this:
fun <E> buildPersistentList(block: PersistentList.Builder<E>.() -> Unit): PersistentList<E> =
persistentListOf<E>().builder().apply(block).build()
I think it's a good idea but it should be inlined because otherwise it doesn't work at @Composable functions.
Addressing the fix to #166, can you take a review?