commonMain.dev.inmo.micro_utils.common.WithReplaced.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro_utils.common Show documentation
Show all versions of micro_utils.common Show documentation
It is set of projects with micro tools for avoiding of routines coding
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