Kotlin / kotlinx.collections.immutable

Immutable persistent collections for Kotlin
Apache License 2.0
1.12k stars 56 forks source link

Add extension functions to convert Array to persistent collections #159

Closed SageDroid closed 6 months ago

SageDroid commented 6 months ago

The plusand minus extension functions for PersistentCollection, PersistentListand PersistentSetsupport Array as argument but there are no extension functions to convert an array to persistent collections.

Example for converting an Array to a PersistentList: fun <T> Array<out T>.toPersistentList(): PersistentList<T> = persistentListOf<T>() + this