diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-10-09 13:35:28 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-10-09 13:35:28 -0400 |
commit | cdc18dea255090d0eb9c1dcd9ffa433665736b18 (patch) | |
tree | fff464beb7a3313e963de128f37f43db490a49ef /Annex.hs | |
parent | 8817fe6331ffc3d99bbf44af559f773af1a2ddd2 (diff) |
fix lockKey to run callback in original Annex monad, not local remote's
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -13,6 +13,7 @@ module Annex ( new, run, eval, + makeRunner, getState, changeState, withState, @@ -203,6 +204,13 @@ eval s a = do mvar <- newMVar s runReaderT (runAnnex a) mvar +{- Makes a runner action, that allows diving into IO and from inside + - the IO action, running an Annex action. -} +makeRunner :: Annex (Annex a -> IO a) +makeRunner = do + mvar <- ask + return $ \a -> runReaderT (runAnnex a) mvar + getState :: (AnnexState -> v) -> Annex v getState selector = do mvar <- ask |