write method

IO<Unit> write(
  1. T value
)

Writes the given value to the IORef and returns a Unit inside the IO monad.

Implementation

IO<Unit> write(T value) => IO(() => _value = value).map((_) => unit);