invoke

suspend operator fun <A> invoke(a: A): Atomic<A>(source)

Creates an AtomicRef with an initial value of A.

Data type on top of atomic to use in parallel functions.

import arrow.fx.coroutines.*

suspend fun main() {
val count = Atomic(0)
(0 until 20_000).parTraverse {
count.update(Int::inc)
}
println(count.get())
}