-- | Swap contents of a PVar for a new value.
swapPVar :: PVar a -> a -> VTx a
swapPVar var new = do
    old <- readPVar var 
    writePVar var new
    return old

swapPVar :: PVar a -> a -> VTx a
swapPVar var new = do
    old <- readPVar var 
    writePVar var new
    return old

swapPVar var new = do
    old <- readPVar var 
    writePVar var new
    return old
