modifyMVar

modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b
base Control.Concurrent.MVar
A slight variation on modifyMVar_ that allows a value to be returned (b) in addition to the modified value of the MVar.
modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()
base Control.Concurrent.MVar
A 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.
modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()
base GHC.Conc.Sync