``` inline fun <T> MutableList<T>.upda...
# stdlib
o
Copy code
inline fun <T> MutableList<T>.update(index: Int, f: T.() -> T) = set(index, f(get(index)))
And use it like
Copy code
data class A(val name: String)
fun test() {
    listOf(A("a")).mutate {
        update(0) { copy(name = "b") }
    }
}