getValue

open operator fun <A> TVar<A>.getValue(thisRef: Nothing?, property: KProperty<*>): 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 {
val x by tvar
x
}
//sampleEnd
println(result)
}