Skip to content

Commit 367d7c4

Browse files
committed
acid-experiment: working migrations
1 parent 83bba75 commit 367d7c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

acid-experiment/Main.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Main (main) where
66

77
import Data.Acid
88
import Data.Acid.Remote
9+
import Data.Acid.Local (createCheckpointAndClose)
910

1011
import Control.Applicative
1112
import Control.Monad.Reader
@@ -73,7 +74,7 @@ instance Migrate KeyValue where
7374

7475
main :: IO ()
7576
main = do args <- getArgs
76-
acid <- openLocalState (KeyValue Map.empty)
77+
acid <- openLocalStateFrom "state/KeyValue" (KeyValue Map.empty)
7778
case args of
7879
[key]
7980
-> do mbKey <- query acid (LookupKey (fromString key))
@@ -86,4 +87,4 @@ main = do args <- getArgs
8687
_ -> do putStrLn "Usage:"
8788
putStrLn " key Lookup the value of 'key'."
8889
putStrLn " key value Set the value of 'key' to 'value'."
89-
closeAcidState acid
90+
createCheckpointAndClose acid

0 commit comments

Comments
 (0)