//arrow-fx-coroutines/arrow.fx.coroutines/Atomic/tryModify

tryModify

common abstract suspend fun <B> tryModify(f: (A) -> Pair<A, B>): B?

Attempts to inspect the state, uptade it, and extract a different state.

tryModify behaves as tryUpdate but allows the update function to return an output value of type B.

Do you like Arrow?

Arrow Org
<