MVar package:relude

An MVar (pronounced "em-var") is a synchronising variable, used for communication between concurrent threads. It can be thought of as a box, which may be empty or full.
A TMVar is a synchronising variable, used for communication between concurrent threads. It can be thought of as a box, which may be empty or full.
Check whether a given TMVar is empty.
Make a Weak pointer to a TMVar, using the second argument as a finalizer to run when the TMVar is garbage-collected.
Lifted to MonadIO version of newEmptyMVar.
Create a TMVar which is initially empty.
Lifted to MonadIO version of newEmptyTMVarIO.
Lifted to MonadIO version of newMVar.
Create a TMVar which contains the supplied value.
Lifted to MonadIO version of newTMVarIO.
Lifted to MonadIO version of putMVar.
Put a value into a TMVar. If the TMVar is currently full, putTMVar will retry.
Lifted to MonadIO version of readMVar.
This is a combination of takeTMVar and putTMVar; ie. it takes the value from the TMVar, puts it back, and also returns it.
Lifted to MonadIO version of swapMVar.
Swap the contents of a TMVar for a new value.
Lifted to MonadIO version of takeMVar.
Return the contents of the TMVar. If the TMVar is currently empty, the transaction will retry. After a takeTMVar, the TMVar is left empty.
Lifted to MonadIO version of tryPutMVar.
A version of putTMVar that does not retry. The tryPutTMVar function attempts to put the value a into the TMVar, returning True if it was successful, or False otherwise.
Lifted to MonadIO version of tryReadMVar.
A version of readTMVar which does not retry. Instead it returns Nothing if no value is available.
Lifted to MonadIO version of tryTakeMVar.
A version of takeTMVar that does not retry. The tryTakeTMVar function returns Nothing if the TMVar was empty, or Just a if the TMVar was full with contents a. After tryTakeTMVar, the TMVar is left empty.