acid-state 0.4 → 0.4.1
raw patch · 3 files changed
+10/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Acid: runQuery :: Query st a -> Update st a
+ Data.Acid.Local: runQuery :: Query st a -> Update st a
Files
- acid-state.cabal +1/−1
- src/Data/Acid.hs +1/−0
- src/Data/Acid/Local.hs +8/−2
acid-state.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.4+Version: 0.4.1 -- A short (one-line) description of the package. Synopsis: Add ACID guarantees to any serializable Haskell data structure.
src/Data/Acid.hs view
@@ -32,6 +32,7 @@ , Query , IsAcidic , makeAcidic+ , runQuery ) where import Data.Acid.Local
src/Data/Acid/Local.hs view
@@ -33,6 +33,7 @@ , query , update' , query'+ , runQuery ) where import Data.Acid.Log as Log@@ -90,8 +91,7 @@ [@Atomicity@] State changes are all-or-nothing. This is what you'd expect of any state variable in Haskell and AcidState doesn't change that. - [@Consistency@] No event or set of events will break your data invariants. This includes- power outages, + [@Consistency@] No event or set of events will break your data invariants. [@Isolation@] Transactions cannot interfere with each other even when issued in parallel. @@ -111,6 +111,12 @@ -- | Context monad for Query events. newtype Query st a = Query { unQuery :: Reader st a } deriving (Monad, MonadReader st)++-- | Run a query in the Update Monad.+runQuery :: Query st a -> Update st a+runQuery query+ = do st <- get+ return (runReader (unQuery query) st) -- | Issue an Update event and wait for its result. Once this call returns, you are -- guaranteed that the changes to the state are durable. Events may be issued in