Reads the value from the Ref
.
Reads the value from the Ref
.
UIO[A]
value from the Ref
Atomically modifies the Ref
with the specified function, which computes
a return value for the modification.
Atomically modifies the Ref
with the specified function, which computes
a return value for the modification. This is a more powerful version of
update
.
type of the value of the Ref
to be modified
function which computes a return value for the modification
UIO[B]
modified value the Ref
Atomically modifies the Ref
with the specified partial function, which computes
a return value for the modification if the function is defined in the current value
otherwise it returns a default value.
Atomically modifies the Ref
with the specified partial function, which computes
a return value for the modification if the function is defined in the current value
otherwise it returns a default value.
This is a more powerful version of updateSome
.
type of the value of the Ref
to be modified
default value to be returned if the partial function is not defined on the current value
partial function to be computed on the current value if defined on the current value
UIO[B]
modified value of the Ref
Writes a new value to the Ref
, with a guarantee of immediate
consistency (at some cost to performance).
Writes a new value to the Ref
, with a guarantee of immediate
consistency (at some cost to performance).
value to be written to the Ref
UIO[Unit]
Writes a new value to the Ref
without providing a guarantee of
immediate consistency.
Writes a new value to the Ref
without providing a guarantee of
immediate consistency.
value to be written to the Ref
UIO[Unit]
Atomically modifies the Ref
with the specified function.
Atomically modifies the Ref
with the specified function. This is not
implemented in terms of modify
purely for performance reasons.
function to atomically modify the Ref
UIO[A]
modified value of the Ref
Atomically modifies the Ref
with the specified partial function.
Atomically modifies the Ref
with the specified partial function.
if the function is undefined in the current value it returns the old value without changing it.
partial function to atomically modify the Ref
UIO[A]
modified value of the Ref
A mutable atomic reference for the
IO
monad. This is theIO
equivalent of a volatilevar
, augmented with atomic operations, which make it useful as a reasonably efficient (if low-level) concurrency primitive.