kotlinx.collections.immutable
kotlinx.collections.immutable copied to clipboard
Immutable persistent collections for Kotlin
Closes #137.
I don't know if it is an oversight or not, but fastutil/JDK caches computed `values`. It is important for IntelliJ IDEA — `PersistentMap.values` called quite often. I realize that modern...
Tried using `ImmutableList`, `ImmutableMap`, `PersistentList`, and `PersistentMap` both in data class constructors and as fields. Kotlin lang: 1.9.20. Deps: ``` sourceSets { commonMain { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7") } } jsMain...
The adapters are located in `kotlinx.collections.immutable.adapters` package and do not have any documentation.
Add `buildPersistentList { }`, `buildPersistentMap { }`, `buildPersistentSet { }` to match the [collection builders in kotlin stdlib](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/build-list.html) I would imagine it would look something like this: ```kotlin fun buildPersistentList(block:...
Using `put` multiple times in `PersistentMap.mutate` block results in `java.util.ConcurrentModificationException`. Can be reproduced in 0.3.5 with the following code: ```kotlin val initialData = Array(100) { i -> i to i...
When a `PersistentVector` is added to another `PersistentVector` through `addAll` this can be optimized and, when the shift alligns, layers of the vector, as a whole, can be copied over...
The following code is used by `SmallPersistentVector` to create persistent list by some collection. ``` val newBuffer = buffer.copyOf(size + elements.size) // TODO: investigate performance of elements.toArray + copyInto var...
Right now you can roll your own mutable version of `ImmutableList` with something like this: ```kotlin class SneakyList( val mutableList: MutableList = mutableListOf() ): ImmutableList { override val size: Int...
Hey, I am calling `subList(0, 1)` on a `PersistentList`. Unfortunately, after the call, I am getting back a `ImmutableList`, which I have to convert to a persistent list again. This...