From bf460a0a98d7e4c7f4eac525fcf300629db582b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Nov 2011 15:34:10 -0400 Subject: reorder repo parameters last Many functions took the repo as their first parameter. Changing it consistently to be the last parameter allows doing some useful things with currying, that reduce boilerplate. In particular, g <- gitRepo is almost never needed now, instead use inRepo to run an IO action in the repo, and fromRepo to get a value from the repo. This also provides more opportunities to use monadic and applicative combinators. --- Backend/SHA.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Backend/SHA.hs') diff --git a/Backend/SHA.hs b/Backend/SHA.hs index d44982117..a3846a410 100644 --- a/Backend/SHA.hs +++ b/Backend/SHA.hs @@ -98,9 +98,8 @@ keyValueE size file = keyValue size file >>= maybe (return Nothing) addE {- A key's checksum is checked during fsck. -} checkKeyChecksum :: SHASize -> Key -> Annex Bool checkKeyChecksum size key = do - g <- gitRepo fast <- Annex.getState Annex.fast - let file = gitAnnexLocation g key + file <- fromRepo $ gitAnnexLocation key present <- liftIO $ doesFileExist file if not present || fast then return True -- cgit v1.2.3