Get started

mutate

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

Returns a new persistent set with the provided modifications applied, or this instance if no modifications were made in the result of this operation.

The mutable set passed to the mutator closure has the same contents as this persistent set.


inline fun <T> PersistentList<T>.mutate(mutator: (MutableList<T>) -> Unit): PersistentList<T>(source)

Returns a new persistent list with the provided modifications applied, or this instance if no modifications were made in the result of this operation.

The mutable list passed to the mutator closure has the same contents as this persistent list.


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

Returns a new persistent map with the provided modifications applied, or this instance if no modifications were made in the result of this operation.

The mutable map passed to the mutator closure has the same contents as this persistent map.