Reads the value from the Ref
.
Reads the value from the Ref
.
UIO[A]
value from the Ref
Atomically writes the specified value to the Ref
, returning the value
immediately before modification.
Atomically writes the specified value to the Ref
, returning the value
immediately before modification. This is not implemented in terms of
modify
purely for performance reasons.
value to be written to the Ref
UIO[A]
value of the Ref
immediately before modification
Atomically modifies the Ref
with the specified function, returning the
value immediately before modification.
Atomically modifies the Ref
with the specified function, returning the
value immediately before modification. This is not implemented in terms of
modify
purely for performance reasons.
function to atomically modify the Ref
UIO[A]
value of the Ref
immediately before modification
Atomically modifies the Ref
with the specified partial function,
returning the value immediately before modification.
Atomically modifies the Ref
with the specified partial function,
returning the value immediately before modification.
If the function is undefined on the current value it doesn't change it.
partial function to atomically modify the Ref
UIO[A]
value of the Ref
immediately before modification
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[Unit]
Atomically modifies the Ref
with the specified function and returns the
updated value.
Atomically modifies the Ref
with the specified function and returns the
updated value. 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 on the current value it doesn't change it.
partial function to atomically modify the Ref
UIO[Unit]
Atomically modifies the Ref
with the specified partial function.
Atomically modifies the Ref
with the specified partial function.
If the function is undefined on 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.NOTE: While
Ref
provides the functional equivalent of a mutable reference, the value inside theRef
should be immutable. For performance reasonsRef
is implemented in terms of compare and swap operations rather than synchronization. These operations are not safe for mutable values that do not support concurrent access.