Skip to content
Snippets Groups Projects
Commit ba4fc48f authored by Jens Nolte's avatar Jens Nolte
Browse files

Add atomically'


Co-authored-by: default avatarJan Beinke <git@janbeinke.com>
parent 76037b6d
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ module Control.Concurrent.STM.Class (
-- ** STM'
STM',
runSTM',
atomically',
-- *** Capabilities
RetryMode(..),
CanRetry,
......@@ -132,6 +134,7 @@ import Control.Concurrent.STM (STM)
import Control.Concurrent.STM qualified as STM
import Control.Concurrent.STM.Class.TH
import Control.Monad.Catch
import Control.Monad.IO.Class
import Control.Monad.Fix (MonadFix)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.RWS (RWST)
......@@ -235,6 +238,11 @@ runSTM' :: MonadSTM m => STM' r t a -> m a
runSTM' (STM' f) = liftSTM f
{-# INLINABLE runSTM' #-}
atomically' :: MonadIO m => STM' CanRetry CanThrow a -> m a
atomically' = liftIO . STM.atomically . runSTM'
{-# INLINABLE atomically' #-}
noRetry :: MonadSTM' r t m => STM' NoRetry t a -> m a
noRetry = unsafeLimitSTM . runSTM'
{-# INLINABLE noRetry #-}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment