Writes the given value to the IORef and returns a Unit inside the IO monad.
Unit
IO<Unit> write(T value) => IO(() => _value = value).map((_) => unit);