
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm
Advanced tools
Kotlin Immutable Collections multiplatform library
Immutable collection interfaces and implementation prototypes for Kotlin.
This is a multiplatform library providing implementations for jvm
, js
, wasmJs
, wasmWasi
and all targets supported by the Kotlin/Native compiler.
For further details see the proposal.
This library provides interfaces for immutable and persistent collections.
Interface | Bases |
---|---|
ImmutableCollection | Collection |
ImmutableList | ImmutableCollection , List |
ImmutableSet | ImmutableCollection , Set |
ImmutableMap | Map |
Interface | Bases |
---|---|
PersistentCollection | ImmutableCollection |
PersistentList | PersistentCollection , ImmutableList |
PersistentSet | PersistentCollection , ImmutableSet |
PersistentMap | ImmutableMap |
Interface | Bases |
---|---|
PersistentCollection.Builder | MutableCollection |
PersistentList.Builder | PersistentCollection.Builder , MutableList |
PersistentSet.Builder | PersistentCollection.Builder , MutableSet |
PersistentMap.Builder | MutableMap |
To instantiate an empty persistent collection or a collection with the specified elements use the functions
persistentListOf
, persistentSetOf
, and persistentMapOf
.
The default implementations of PersistentSet
and PersistentMap
, which are returned by persistentSetOf
and persistentMapOf
,
preserve the element insertion order during iteration. This comes at expense of maintaining more complex data structures.
If the order of elements doesn't matter, the more efficient implementations returned by the functions
persistentHashSetOf
and persistentHashMapOf
can be used.
Converts a read-only or mutable collection to an immutable one. If the receiver is already immutable and has the required type, returns it as is.
fun Iterable<T>.toImmutableList(): ImmutableList<T>
fun Iterable<T>.toImmutableSet(): ImmutableSet<T>
Converts a read-only or mutable collection to a persistent one.
If the receiver is already persistent and has the required type, returns it as is.
If the receiver is a builder of the required persistent collection type, calls build
on it and returns the result.
fun Iterable<T>.toPersistentList(): PersistentList<T>
fun Iterable<T>.toPersistentSet(): PersistentSet<T>
+
and -
operatorsplus
and minus
operators on persistent collections exploit their immutability
and delegate the implementation to the collections themselves.
The operation is performed with persistence in mind: the returned immutable collection may share storage
with the original collection.
val newList = persistentListOf("a", "b") + "c"
// newList is also a PersistentList
Note: you need to import these operators from
kotlinx.collections.immutable
package in order for them to take the precedence over the ones from the standard library.
import kotlinx.collections.immutable.*
mutate
extension function simplifies quite common pattern of persistent collection modification:
get a builder, apply some mutating operations on it, transform it back to a persistent collection:
collection.builder().apply { some_actions_on(this) }.build()
With mutate
it transforms to:
collection.mutate { some_actions_on(it) }
Note that the library is experimental and the API is subject to change.
The library is published to Maven Central repository.
The library depends on the Kotlin Standard Library of the version at least 1.9.21
.
Add the Maven Central repository:
repositories {
mavenCentral()
}
Add the library to dependencies of the platform source set, e.g.:
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7")
}
}
}
}
The Maven Central repository is available for dependency lookup by default. Add dependencies (you can also add other modules that you need):
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-collections-immutable-jvm</artifactId>
<version>0.3.7</version>
</dependency>
You can build and install artifacts to maven local with:
gradlew build install
FAQs
Unknown package
We found that org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.