Kotlin / kotlinx.collections.immutable

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

PersistentList is missing a subList that returns a new PersistentList (currently returns ImmutableList) #150

Open carstenhag opened 10 months ago

carstenhag commented 10 months ago

Hey, I am calling subList(0, 1) on a PersistentList<E>.
Unfortunately, after the call, I am getting back a ImmutableList<E>, which I have to convert to a persistent list again.

This is the method that is being used:

override fun subList(fromIndex: Int, toIndex: Int): ImmutableList<E> = SubList(this, fromIndex, toIndex)

ilya-g commented 10 months ago

What operations of persistent list do you need to carry on the returned sublist?