arrow-fx / arrow.fx / Ref / access

access

abstract fun access(): Kind<F, Tuple2<A, (A) -> Kind<F, Boolean>>>

Obtains a snapshot of the current value, and a setter for updating it.

The setter will return false if another concurrent call invalidated the snapshot (modified the value). It will return true if setting the value was successful.

Once it has returned false or been used once, a setter never succeeds again.

Do you like Arrow?

Arrow Org
<