summaryrefslogtreecommitdiff
path: root/Types.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-14 02:36:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-14 02:36:41 -0400
commit48643b68b3ff05399b72f44b8b02ff34d6de046c (patch)
tree530364b80bada325413dfa86f7b5e68ee007ee27 /Types.hs
parenteda80e44c5fb399fa4e5625388d6e0f993b0f779 (diff)
convert GitRepo to qualified import
Diffstat (limited to 'Types.hs')
-rw-r--r--Types.hs24
1 files changed, 6 insertions, 18 deletions
diff --git a/Types.hs b/Types.hs
index ce377dda1..c9d33affd 100644
--- a/Types.hs
+++ b/Types.hs
@@ -1,26 +1,14 @@
{- git-annex core data types -}
-module Types (
- Annex,
- AnnexState,
- makeAnnexState,
- runAnnexState,
- gitAnnex,
- gitAnnexChange,
- backendsAnnex,
- backendsAnnexChange,
-
- Key(..),
- Backend(..)
-) where
+module Types where
import Control.Monad.State
import Data.String.Utils
-import GitRepo
+import qualified GitRepo as Git
-- git-annex's runtime state
data AnnexState = AnnexState {
- repo :: GitRepo,
+ repo :: Git.Repo,
backends :: [Backend]
} deriving (Show)
@@ -28,18 +16,18 @@ data AnnexState = AnnexState {
type Annex = StateT AnnexState IO
-- constructor
-makeAnnexState :: GitRepo -> AnnexState
+makeAnnexState :: Git.Repo -> AnnexState
makeAnnexState g = AnnexState { repo = g, backends = [] }
-- performs an action in the Annex monad
runAnnexState state action = runStateT (action) state
-- Annex monad state accessors
-gitAnnex :: Annex GitRepo
+gitAnnex :: Annex Git.Repo
gitAnnex = do
state <- get
return (repo state)
-gitAnnexChange :: GitRepo -> Annex ()
+gitAnnexChange :: Git.Repo -> Annex ()
gitAnnexChange r = do
state <- get
put state { repo = r }