modifyIORef<T> function

IO<Unit> modifyIORef<T>(
  1. Endo<T> update,
  2. IORef<T> ref

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.


IO<Unit> modifyIORef<T>(Endo<T> update, IORef<T> ref) => ref.modify(update);