arrow-fx / arrow.fx / Ref / tryModify
tryModify
abstract fun <B> tryModify(f: (A) -> Tuple2<A, B>): Kind<F, Option<B>>
Like tryUpdate but allows the update function to return an output value of type B.
Returns
None if the update fails and Some(b)
otherwise.