summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-25 00:28:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-25 01:27:19 -0400
commit678726c10c13481c082743808a5188d28567e2b3 (patch)
treea5052eb5b20444e10d3f5d467281ef4c0f5975d1 /Annex.hs
parent20259c2955e408a72e0960207fc8be4cbeec2e21 (diff)
code simplification thanks to applicative functors
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Annex.hs b/Annex.hs
index 07316bd37..287aed875 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -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)