Package-level declarations

Types

Link copied to clipboard
interface ImmutableCollection<out E> : Collection<E>

A generic immutable collection of elements. Methods in this interface support only read-only access to the collection.

Link copied to clipboard
interface ImmutableList<out E> : List<E> , ImmutableCollection<E>

A generic immutable ordered collection of elements. Methods in this interface support only read-only access to the immutable list.

Link copied to clipboard
interface ImmutableMap<K, out V> : Map<K, V>

A generic immutable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the immutable map.

Link copied to clipboard
interface ImmutableSet<out E> : Set<E> , ImmutableCollection<E>

A generic immutable unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the immutable set.

Link copied to clipboard

A generic persistent collection of elements that supports adding and removing elements.

Link copied to clipboard

A generic persistent ordered collection of elements that supports adding and removing elements.

Link copied to clipboard
interface PersistentMap<K, out V> : ImmutableMap<K, V>

A generic persistent collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

Link copied to clipboard

A generic persistent unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

Functions

Link copied to clipboard

Returns all elements in this collection that are also contained in the specified elements collection.

infix fun <E> PersistentSet<E>.intersect(elements: Iterable<E>): PersistentSet<E>

Returns all elements in this set that are also contained in the specified elements collection.

Link copied to clipboard
inline operator fun <E> PersistentCollection<E>.minus(element: E): PersistentCollection<E>

Returns the result of removing a single appearance of the specified element from this collection.

operator fun <E> PersistentCollection<E>.minus(elements: Array<out E>): PersistentCollection<E>

Returns the result of removing all elements in this collection that are also contained in the specified elements array.

Returns the result of removing all elements in this collection that are also contained in the specified elements collection.

Returns the result of removing all elements in this collection that are also contained in the specified elements sequence.

inline operator fun <E> PersistentList<E>.minus(element: E): PersistentList<E>

Returns the result of removing the first appearance of the specified element from this list.

operator fun <E> PersistentList<E>.minus(elements: Array<out E>): PersistentList<E>

Returns the result of removing all elements in this list that are also contained in the specified elements array.

operator fun <E> PersistentList<E>.minus(elements: Iterable<E>): PersistentList<E>

Returns the result of removing all elements in this list that are also contained in the specified elements collection.

operator fun <E> PersistentList<E>.minus(elements: Sequence<E>): PersistentList<E>

Returns the result of removing all elements in this list that are also contained in the specified elements sequence.

operator fun <K, V> PersistentMap<out K, V>.minus(key: K): PersistentMap<K, V>

Returns the result of removing the specified key and its corresponding value from this map.

operator fun <K, V> PersistentMap<out K, V>.minus(keys: Array<out K>): PersistentMap<K, V>
operator fun <K, V> PersistentMap<out K, V>.minus(keys: Iterable<K>): PersistentMap<K, V>
operator fun <K, V> PersistentMap<out K, V>.minus(keys: Sequence<K>): PersistentMap<K, V>

Returns the result of removing the specified keys and their corresponding values from this map.

inline operator fun <E> PersistentSet<E>.minus(element: E): PersistentSet<E>

Returns the result of removing the specified element from this set.

operator fun <E> PersistentSet<E>.minus(elements: Array<out E>): PersistentSet<E>

Returns the result of removing all elements in this set that are also contained in the specified elements array.

operator fun <E> PersistentSet<E>.minus(elements: Iterable<E>): PersistentSet<E>

Returns the result of removing all elements in this set that are also contained in the specified elements collection.

operator fun <E> PersistentSet<E>.minus(elements: Sequence<E>): PersistentSet<E>

Returns the result of removing all elements in this set that are also contained in the specified elements sequence.

Link copied to clipboard
inline fun <T> PersistentList<T>.mutate(mutator: (MutableList<T>) -> Unit): PersistentList<T>

Returns the result of applying the provided modifications on this list.

inline fun <K, V> PersistentMap<out K, V>.mutate(mutator: (MutableMap<K, V>) -> Unit): PersistentMap<K, V>

Returns the result of applying the provided modifications on this map.

inline fun <T> PersistentSet<T>.mutate(mutator: (MutableSet<T>) -> Unit): PersistentSet<T>

Returns the result of applying the provided modifications on this set.

Link copied to clipboard

Returns an empty persistent map.

fun <K, V> persistentHashMapOf(vararg pairs: Pair<K, V>): PersistentMap<K, V>

Returns a new persistent map with the specified contents, given as a list of pairs where the first component is the key and the second is the value.

Link copied to clipboard

Returns an empty persistent set.

fun <E> persistentHashSetOf(vararg elements: E): PersistentSet<E>

Returns a new persistent set with the given elements.

Link copied to clipboard

Returns an empty persistent list.

fun <E> persistentListOf(vararg elements: E): PersistentList<E>

Returns a new persistent list of the specified elements.

Link copied to clipboard

Returns an empty persistent map.

fun <K, V> persistentMapOf(vararg pairs: Pair<K, V>): PersistentMap<K, V>

Returns a new persistent map with the specified contents, given as a list of pairs where the first component is the key and the second is the value.

Link copied to clipboard

Returns an empty persistent set.

fun <E> persistentSetOf(vararg elements: E): PersistentSet<E>

Returns a new persistent set with the given elements.

Link copied to clipboard
inline operator fun <E> PersistentCollection<E>.plus(element: E): PersistentCollection<E>

Returns the result of adding the specified element to this collection.

operator fun <E> PersistentCollection<E>.plus(elements: Array<out E>): PersistentCollection<E>

Returns the result of adding all elements of the specified elements array to this collection.

Returns the result of adding all elements of the specified elements collection to this collection.

Returns the result of adding all elements of the specified elements sequence to this collection.

inline operator fun <E> PersistentList<E>.plus(element: E): PersistentList<E>

Returns a new persistent list with the specified element appended.

operator fun <E> PersistentList<E>.plus(elements: Array<out E>): PersistentList<E>

Returns the result of appending all elements of the specified elements array to this list.

operator fun <E> PersistentList<E>.plus(elements: Iterable<E>): PersistentList<E>

Returns the result of appending all elements of the specified elements collection to this list.

operator fun <E> PersistentList<E>.plus(elements: Sequence<E>): PersistentList<E>

Returns the result of appending all elements of the specified elements sequence to this list.

inline operator fun <K, V> PersistentMap<out K, V>.plus(pairs: Array<out Pair<K, V>>): PersistentMap<K, V>
inline operator fun <K, V> PersistentMap<out K, V>.plus(pairs: Iterable<Pair<K, V>>): PersistentMap<K, V>
inline operator fun <K, V> PersistentMap<out K, V>.plus(pairs: Sequence<Pair<K, V>>): PersistentMap<K, V>

Returns the result of replacing or adding entries to this map from the specified key-value pairs.

inline operator fun <K, V> PersistentMap<out K, V>.plus(pair: Pair<K, V>): PersistentMap<K, V>

Returns the result of adding an entry to this map from the specified key-value pair.

inline operator fun <K, V> PersistentMap<out K, V>.plus(map: Map<out K, V>): PersistentMap<K, V>

Returns the result of merging the specified map with this map.

inline operator fun <E> PersistentSet<E>.plus(element: E): PersistentSet<E>

Returns the result of adding the specified element to this set.

operator fun <E> PersistentSet<E>.plus(elements: Array<out E>): PersistentSet<E>

Returns the result of adding all elements of the specified elements array to this set.

operator fun <E> PersistentSet<E>.plus(elements: Iterable<E>): PersistentSet<E>

Returns the result of adding all elements of the specified elements collection to this set.

operator fun <E> PersistentSet<E>.plus(elements: Sequence<E>): PersistentSet<E>

Returns the result of adding all elements of the specified elements sequence to this set.

Link copied to clipboard
fun <K, V> PersistentMap<out K, V>.putAll(pairs: Array<out Pair<K, V>>): PersistentMap<K, V>
fun <K, V> PersistentMap<out K, V>.putAll(pairs: Iterable<Pair<K, V>>): PersistentMap<K, V>
fun <K, V> PersistentMap<out K, V>.putAll(pairs: Sequence<Pair<K, V>>): PersistentMap<K, V>

Returns the result of replacing or adding entries to this map from the specified key-value pairs.

fun <K, V> PersistentMap<out K, V>.putAll(map: Map<out K, V>): PersistentMap<K, V>

Returns the result of merging the specified map with this map.

Link copied to clipboard

Returns an immutable list containing all elements of this array.

Returns an immutable list containing all characters.

Returns an immutable list containing all elements of this collection.

Returns an immutable list containing all elements of this sequence.

Link copied to clipboard

Returns an immutable map containing all entries from this map.

Link copied to clipboard

Returns an immutable set of all elements of this array.

Returns an immutable set of all characters.

Returns an immutable set of all elements of this collection.

Returns an immutable set of all elements of this sequence.

Link copied to clipboard

Returns an immutable map containing all entries from this map.

Link copied to clipboard

Returns a persistent set of all elements of this array.

Returns a persistent set of all characters.

Returns a persistent set containing all elements from this set.

Returns a persistent set of all elements of this sequence.

Link copied to clipboard

Returns a persistent list containing all elements of this array.

Returns a persistent list containing all characters.

Returns a persistent list containing all elements of this collection.

Returns a persistent list containing all elements of this sequence.

Link copied to clipboard

Returns a persistent map containing all entries from this map.

Link copied to clipboard

Returns a persistent set of all elements of this array.

Returns a persistent set of all characters.

Returns a persistent set of all elements of this collection.

Returns a persistent set of all elements of this sequence.