summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-12-26 22:22:34 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-12-27 13:57:07 +0100
commit2903fd39c39357168a7cbb8b6821a0c99ed1e5a7 (patch)
tree75f58e2ea12f57a9381fda69e14f955a45e26592 /src/Main.hs
parented2fd1bf1f2e24565530bcfc9853cacbfa1c2a2a (diff)
Generalize local state helper functions
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 9dcbae9..1515648 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -99,7 +99,7 @@ main = do
Nothing -> error "ref does not exist"
Just ref -> print $ storedGeneration (wrappedLoad ref :: Stored Object)
- ["update-identity"] -> updateSharedIdentity =<< loadLocalStateHead st
+ ["update-identity"] -> runReaderT updateSharedIdentity =<< loadLocalStateHead st
("update-identity" : srefs) -> do
sequence <$> mapM (readRef st . BC.pack) srefs >>= \case
@@ -290,8 +290,7 @@ cmdHistory = void $ do
cmdUpdateIdentity :: Command
cmdUpdateIdentity = void $ do
- ehead <- asks ciHead
- liftIO $ updateSharedIdentity ehead
+ runReaderT updateSharedIdentity =<< asks ciHead
cmdAttach :: Command
cmdAttach = join $ attachToOwner