Mutable reference in the IO monad.
Allows having a reference that can be read and mutated inside the IO monad. Can be used in conjunction with a closure to preserve a state across multiple IO function calls, or in any other case where code is run inside an IO monad.
Endo< T> update) → IO< Unit>
- Works almost identical to the write method, but instead of taking a value that needs to be written, takes an Endo function, applies the IORef's current value to it and writes the result to the IORef.
Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
) → IO< T>
- Extracts a current value of the IORef and returns it inside the IO monad.
) → String
A string representation of this object.
T value) → IO< Unit>
Writes the given value to the IORef and returns a
Unitinside the IO monad.