transform

open fun <A> TArray<A>.transform(f: (A) -> A)

Modify each element in a TArray by applying f.

import arrow.fx.stm.TArray
import arrow.fx.stm.atomically

suspend fun main() {
//sampleStart
val tarr = TArray.new(size = 10, 2)
val result = atomically {
tarr.transform { it + 1 }
}
//sampleEnd
println("Result $result")
}

This function never retries.