setValue

open operator fun <A> TVar<A>.setValue(thisRef: Nothing?, property: KProperty<*>, value: A)

Use a TVar using property delegation.

import arrow.fx.stm.TVar
import arrow.fx.stm.atomically

suspend fun main() {
//sampleStart
val tvar = TVar.new(10)
val result = atomically {
var x by tvar
x = 20
}
//sampleEnd
println(result)
}