Get started

plus

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

Returns a new persistent collection with the specified element added, or this instance if this collection does not support duplicates and it already contains the element.


Returns a new persistent collection with elements of the specified elements collection added, or this instance if no modifications were made in the result of this operation.


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

Returns a new persistent collection with elements of the specified elements array added, or this instance if no modifications were made in the result of this operation.


Returns a new persistent collection with elements of the specified elements sequence added, or this instance if no modifications were made in the result of this operation.


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

Returns a new persistent list with the specified element appended.


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

Returns a new persistent list with elements of the specified elements collection appended, or this instance if the specified collection is empty.

The elements are appended in the order they appear in the specified collection.


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

Returns a new persistent list with elements of the specified elements array appended, or this instance if the specified array is empty.

The elements are appended in the order they appear in the specified array.


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

Returns a new persistent list with elements of the specified elements sequence appended, or this instance if the specified sequence is empty.

The elements are appended in the order they appear in the specified sequence.


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

Returns a new persistent set with the specified element added, or this instance if it already contains the element.


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

Returns a new persistent set with elements of the specified elements collection added, or this instance if it already contains every element of the specified collection.


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

Returns a new persistent set with elements of the specified elements array added, or this instance if it already contains every element of the specified array.


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

Returns a new persistent set with elements of the specified elements sequence added, or this instance if it already contains every element of the specified sequence.


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

Returns a new persistent map with an entry from the specified key-value pair added, or this instance if no modifications were made in the result of this operation.

If this map already contains a mapping for the key, the old value is replaced by the value from the specified pair.


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

Returns a new persistent map with entries from the specified key-value pairs added, or this instance if no modifications were made in the result of this operation.


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

Returns a new persistent map with keys and values from the specified map associated, or this instance if no modifications were made in the result of this operation.

The effect of this call is equivalent to that of calling put(k, v) once for each mapping from key k to value v in the specified map.