more monadic operator use

This commit is contained in:
Joey Hess 2011-05-15 15:27:49 -04:00
parent 1e5beda86a
commit 6aab88fa25
5 changed files with 11 additions and 20 deletions

View file

@ -86,9 +86,7 @@ getState c = liftM c get
- Example: changeState (\s -> s { quiet = True })
-}
changeState :: (AnnexState -> AnnexState) -> Annex ()
changeState a = do
state <- get
put (a state)
changeState a = put . a =<< get
{- Returns the git repository being acted on -}
gitRepo :: Annex Git.Repo