arrow-fx / arrow.fx / Ref / getAndSet
abstract fun getAndSet(a: A): Kind<F, A>
Replaces the current value with a, returning the old value.
Do you like Arrow?