packages feed

concurrent-state 0.3.1.1 → 0.3.2.0

raw patch · 3 files changed

+4/−34 lines, 3 files

Files

concurrent-state.cabal view
@@ -1,7 +1,7 @@ name:                concurrent-state-version:             0.3.1.1+version:             0.3.2.0 synopsis:            MTL-like library using TVars-description:         State and Writer backed by TVars.+description:         State backed by TVar. homepage:            https://github.com/joelteon/concurrent-state license:             MIT license-file:        LICENSE
src/Control/Monad/State/Concurrent/Lazy.hs view
@@ -19,9 +19,6 @@     -- *** The StateC monad transformer     StateC, -    -- *** Specializations of MonadState operations-    modify,-     -- *** Concurrent state operations     runStateC, evalStateC, execStateC, @@ -32,7 +29,7 @@ import Control.Applicative import Control.Concurrent.STM import Control.Monad-import Control.Monad.State hiding (modify)+import Control.Monad.State  -- --------------------------------------------------------------------------- -- | A concurrent state transformer monad parameterized by:@@ -92,18 +89,6 @@     liftIO i = StateC $ \s -> do         a <- liftIO i         return (a, s)---- | Monadic state transformer. Maps an old state to a new state inside--- a state monad. The old state is thrown away.------ This is provided because "Control.Monad.State"'s modify function is--- defined in terms of 'get' and 'put', which results in two STM actions--- for every modify. Instead, 'modify' can be specialized as a call to--- 'modifyTVar'.-modify :: MonadIO m => (s -> s) -> StateC s m ()-modify s = StateC $ \tv -> do-    liftIO . atomically $ modifyTVar tv s-    return ((), tv)  -- | Unwrap a concurrent state monad computation as a function. runStateC :: MonadIO m
src/Control/Monad/State/Concurrent/Strict.hs view
@@ -19,9 +19,6 @@     -- *** The StateC monad transformer     StateC, -    -- *** Specializations of MonadState operations-    modify,-     -- *** Concurrent state operations     runStateC, evalStateC, execStateC, @@ -33,7 +30,7 @@ import Control.Arrow (first) import Control.Concurrent.STM import Control.Monad-import Control.Monad.State hiding (modify)+import Control.Monad.State  -- --------------------------------------------------------------------------- -- | A concurrent state transformer monad parameterized by:@@ -93,18 +90,6 @@     liftIO i = StateC $ \s -> do         a <- liftIO i         return (a, s)---- | Monadic state transformer. Maps an old state to a new state inside--- a state monad. The old state is thrown away.------ This is provided because "Control.Monad.State"'s modify function is--- defined in terms of 'get' and 'put', which results in two STM actions--- for every modify. Instead, 'modify' can be specialized as a call to--- 'modifyTVar''.-modify :: MonadIO m => (s -> s) -> StateC s m ()-modify s = StateC $ \tv -> do-    liftIO . atomically $ modifyTVar' tv s-    return ((), tv)  -- | Unwrap a concurrent state monad computation as a function. runStateC :: MonadIO m