summaryrefslogtreecommitdiff
path: root/git-annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-28 12:40:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-28 12:40:05 -0400
commit045b051ec10023afc2e62895032527d5b5130495 (patch)
treea438d96566ccebbccf5c1ec1d35e43d2c5097578 /git-annex.hs
parent9c7b3dce9e8f964ed60dd45bca580a46ff8a5ed5 (diff)
got rid of almost all 'return ()'
Diffstat (limited to 'git-annex.hs')
-rw-r--r--git-annex.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/git-annex.hs b/git-annex.hs
index e9e7ff027..5011fade2 100644
--- a/git-annex.hs
+++ b/git-annex.hs
@@ -8,6 +8,7 @@
import IO (try)
import System.IO
import System.Environment
+import Monad
import qualified Annex
import Types
@@ -42,12 +43,8 @@ tryRun' state errnum (a:as) = do
tryRun' state (errnum + 1) as
Right (True,state') -> tryRun' state' errnum as
Right (False,state') -> tryRun' state' (errnum + 1) as
-tryRun' state errnum [] = do
- if (errnum > 0)
- then error $ (show errnum) ++ " failed"
- else return ()
+tryRun' state errnum [] =
+ when (errnum > 0) $ error $ (show errnum) ++ " failed"
{- Exception pretty-printing. -}
-showErr e = do
- hPutStrLn stderr $ "git-annex: " ++ (show e)
- return ()
+showErr e = hPutStrLn stderr $ "git-annex: " ++ (show e)