TVar package:stm

Shared memory locations that support atomic memory transactions.
Make a Weak pointer to a TVar, using the second argument as a finalizer to run when TVar is garbage-collected
Mutate the contents of a TVar. N.B., this version is non-strict.
Strict version of modifyTVar.
Create a new TVar holding a value supplied
IO version of newTVar. This is useful for creating top-level TVars using unsafePerformIO, because using atomically inside unsafePerformIO isn't possible.
Return the current value stored in a TVar.
Return the current value stored in a TVar. This is equivalent to
readTVarIO = atomically . readTVar
but works much faster, because it doesn't perform a complete transaction, it just reads the current value of the TVar.
Like modifyTVar' but the function is a simple state transition that can return a side value which is passed on as the result of the STM.
Swap the contents of a TVar for a new value.
Write the supplied value into a TVar.