module Haskus.Utils.STM
( S.STM
, S.retry
, atomically
, S.TVar
, newTVarIO
, readTVarIO
, S.writeTVar
, S.readTVar
, S.newTVar
, S.swapTVar
, S.modifyTVar
, S.modifyTVar'
, S.TMVar
, newTMVarIO
, S.isEmptyTMVar
, S.newEmptyTMVar
, S.newEmptyTMVarIO
, S.readTMVar
, S.takeTMVar
, S.putTMVar
, S.swapTMVar
, S.tryReadTMVar
, S.tryPutTMVar
, S.tryTakeTMVar
, S.TChan
, newBroadcastTChanIO
, S.newBroadcastTChan
, S.writeTChan
, S.dupTChan
, S.readTChan
)
where
import Control.Concurrent.STM (STM, TVar, TMVar, TChan)
import qualified Control.Concurrent.STM as S
import Haskus.Utils.Monad
atomically :: MonadIO m => STM a -> m a
atomically = liftIO . S.atomically
readTVarIO :: MonadIO m => TVar a -> m a
readTVarIO = liftIO . S.readTVarIO
newBroadcastTChanIO :: MonadIO m => m (TChan a)
newBroadcastTChanIO = liftIO S.newBroadcastTChanIO
newTVarIO :: MonadIO m => a -> m (TVar a)
newTVarIO = liftIO . S.newTVarIO
newTMVarIO :: MonadIO m => a -> m (TMVar a)
newTMVarIO = liftIO . S.newTMVarIO