All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dev.inmo.micro_utils.common.WithReplaced.kt Maven / Gradle / Ivy

There is a newer version: 0.24.4
Show newest version
package dev.inmo.micro_utils.common

fun  Iterable.withReplacedAt(i: Int, block: (T) -> T): List = take(i) + block(elementAt(i)) + drop(i + 1)
fun  Iterable.withReplaced(t: T, block: (T) -> T): List = withReplacedAt(indexOf(t), block)





© 2015 - 2025 Weber Informatics LLC | Privacy Policy