hello, liftM
This commit is contained in:
parent
208fb142d4
commit
dd0f662849
3 changed files with 12 additions and 26 deletions
4
Annex.hs
4
Annex.hs
|
@ -75,9 +75,7 @@ eval state action = evalStateT action state
|
|||
{- Gets a value from the internal state, selected by the passed value
|
||||
- constructor. -}
|
||||
getState :: (AnnexState -> a) -> Annex a
|
||||
getState c = do
|
||||
state <- get
|
||||
return (c state)
|
||||
getState c = liftM c get
|
||||
|
||||
{- Applies a state mutation function to change the internal state.
|
||||
-
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue