An exception-safe wrapper for modifying the contents of an
MVar. Like
withMVar,
modifyMVar will replace the
original contents of the
MVar if an exception is raised during
the operation. This function is only atomic if there are no other
producers for this
MVar. In other words, it cannot guarantee
that, by the time
modifyMVar_ gets the chance to write to the
MVar, the value of the MVar has not been altered by a write operation
from another thread.