concurrent-state 0.5.1.0 → 0.5.1.1
raw patch · 6 files changed
+17/−1 lines, 6 files
Files
- changelog +4/−0
- concurrent-state.cabal +1/−1
- src/Control/Monad/RWS/Concurrent/Lazy.hs +3/−0
- src/Control/Monad/RWS/Concurrent/Strict.hs +3/−0
- src/Control/Monad/State/Concurrent/Lazy.hs +3/−0
- src/Control/Monad/State/Concurrent/Strict.hs +3/−0
changelog view
@@ -1,3 +1,7 @@+0.5.1.1+-------+* Specialize `get' for StateC and RWSC to avoid an STM transaction+ 0.5.1.0 ------- * Remove `Monoid w` constraint from MonadFork instances for RWS
concurrent-state.cabal view
@@ -1,5 +1,5 @@ name: concurrent-state-version: 0.5.1.0+version: 0.5.1.1 synopsis: MTL-like library using TVars description: State, RWS backed by TVar. homepage: https://github.com/joelteon/concurrent-state
src/Control/Monad/RWS/Concurrent/Lazy.hs view
@@ -100,6 +100,9 @@ return (a, s', tw') instance (MonadIO m, MonadState s m) => MonadState s (RWSC r w s m) where+ get = RWSC $ \_ tv w -> do+ s <- liftIO $ readTVarIO tv+ return (s, tv, w) state f = RWSC $ \_ tv w -> do newval <- liftIO . atomically $ do old <- readTVar tv
src/Control/Monad/RWS/Concurrent/Strict.hs view
@@ -100,6 +100,9 @@ return (a, s', tw') instance (MonadIO m, MonadState s m) => MonadState s (RWSC r w s m) where+ get = RWSC $ \_ tv w -> do+ s <- liftIO $ readTVarIO tv+ return (s, tv, w) state f = RWSC $ \_ tv w -> do newval <- liftIO . atomically $ do old <- readTVar tv
src/Control/Monad/State/Concurrent/Lazy.hs view
@@ -85,6 +85,9 @@ _runStateC (k a) s' instance (Functor m, MonadIO m) => MonadState s (StateC s m) where+ get = StateC $ \tv -> do+ s <- liftIO $ readTVarIO tv+ return (s, tv) state f = StateC $ \tv -> do newval <- liftIO . atomically $ do old <- readTVar tv
src/Control/Monad/State/Concurrent/Strict.hs view
@@ -86,6 +86,9 @@ _runStateC (k a) s' instance (Functor m, MonadIO m) => MonadState s (StateC s m) where+ get = StateC $ \tv -> do+ s <- liftIO $ readTVarIO tv+ return (s, tv) state f = StateC $ \tv -> do newval <- liftIO . atomically $ do old <- readTVar tv