diff options
author | Joey Hess <joey@kitenet.net> | 2011-08-25 00:28:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-08-25 01:27:19 -0400 |
commit | 678726c10c13481c082743808a5188d28567e2b3 (patch) | |
tree | a5052eb5b20444e10d3f5d467281ef4c0f5975d1 /Annex.hs | |
parent | 20259c2955e408a72e0960207fc8be4cbeec2e21 (diff) |
code simplification thanks to applicative functors
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -20,6 +20,7 @@ module Annex ( import Control.Monad.State import Control.Monad.IO.Control +import Control.Applicative hiding (empty) import qualified Git import Git.Queue @@ -36,7 +37,9 @@ newtype Annex a = Annex { runAnnex :: StateT AnnexState IO a } Monad, MonadIO, MonadControlIO, - MonadState AnnexState + MonadState AnnexState, + Functor, + Applicative ) -- internal state storage @@ -83,7 +86,7 @@ newState gitrepo = AnnexState {- Create and returns an Annex state object for the specified git repo. -} new :: Git.Repo -> IO AnnexState -new gitrepo = newState `liftM` Git.configRead gitrepo +new gitrepo = newState <$> Git.configRead gitrepo {- performs an action in the Annex monad -} run :: AnnexState -> Annex a -> IO (a, AnnexState) |