snaplet-acid-state 0.2.3.2 → 0.2.4
raw patch · 2 files changed
+26/−3 lines, 2 filesdep ~acid-statedep ~snapPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: acid-state, snap
API changes (from Hackage documentation)
+ Snap.Snaplet.AcidState: acidInitMemory :: IsAcidic st => st -> SnapletInit b (Acid st)
Files
snaplet-acid-state.cabal view
@@ -1,5 +1,5 @@ name: snaplet-acid-state-version: 0.2.3.2+version: 0.2.4 synopsis: acid-state snaplet for Snap Framework description: This snaplet makes it easy to use acid-state in a Snap application.@@ -25,9 +25,9 @@ Snap.Snaplet.AcidState build-depends:- acid-state >= 0.6 && < 0.11,+ acid-state >= 0.6 && < 0.12, base >= 4 && < 5,- snap >= 0.6 && < 0.13,+ snap >= 0.6 && < 0.14, text >= 0.11 && < 0.12 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields
src/Snap/Snaplet/AcidState.hs view
@@ -12,6 +12,7 @@ , HasAcid(..) , acidInit , acidInit'+ , acidInitMemory , getAcidState , update , query@@ -24,6 +25,7 @@ import qualified Data.Acid as A import qualified Data.Acid.Advanced as A+import qualified Data.Acid.Memory as AM import Data.Acid hiding (update ,query ,createCheckpoint@@ -68,6 +70,27 @@ -> SnapletInit b (Acid st) acidInit' location initial = makeSnaplet "acid-state" description Nothing $ initWorker (A.openLocalStateFrom location initial)++------------------------------------------------------------------------------+-- | Initializer allowing you to open an in-memory store (typically for testing)+acidInitMemory :: A.IsAcidic st+ => st+ -- ^ Initial state to be used if + -> SnapletInit b (Acid st)+acidInitMemory initial = makeSnaplet "acid-state" description Nothing $+ initWorker (AM.openMemoryState initial)+++------------------------------------------------------------------------------+-- | Initializer allowing you to specify the AcidState to use. This AcidState+-- must be initialized manually elsewhere. It will not be automatically+-- closed by the snaplet.+acidInitManual :: A.IsAcidic st+ => AcidState st+ -- ^ AcidState state to be used+ -> SnapletInit b (Acid st)+acidInitManual initial = makeSnaplet "acid-state" description Nothing $+ return $ Acid initial ------------------------------------------------------------------------------