diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-28 12:40:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-28 12:40:05 -0400 |
commit | 045b051ec10023afc2e62895032527d5b5130495 (patch) | |
tree | a438d96566ccebbccf5c1ec1d35e43d2c5097578 /git-annex.hs | |
parent | 9c7b3dce9e8f964ed60dd45bca580a46ff8a5ed5 (diff) |
got rid of almost all 'return ()'
Diffstat (limited to 'git-annex.hs')
-rw-r--r-- | git-annex.hs | 11 |
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) |