summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-02 15:01:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-02 15:01:58 -0400
commit16ca22c60af39cc06db62215a1ac12cd5ae7a3c5 (patch)
treecf3f0c6ea6297087cab68ca8317e85b64f57406c /Annex
parent13aeb89e2a1a44c9404fef93cb3dcdced618285f (diff)
avoid warnings when built with ghc 7.6
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Exception.hs17
1 files changed, 10 insertions, 7 deletions
diff --git a/Annex/Exception.hs b/Annex/Exception.hs
index 96070ee26..99466a851 100644
--- a/Annex/Exception.hs
+++ b/Annex/Exception.hs
@@ -13,24 +13,27 @@
module Annex.Exception (
bracketIO,
tryAnnex,
- throw,
+ throwAnnex,
catchAnnex,
) where
-import Prelude hiding (catch)
-import "MonadCatchIO-transformers" Control.Monad.CatchIO (bracket, try, throw, catch)
-import Control.Exception hiding (handle, try, throw, bracket, catch)
+import qualified "MonadCatchIO-transformers" Control.Monad.CatchIO as M
+import Control.Exception
import Common.Annex
{- Runs an Annex action, with setup and cleanup both in the IO monad. -}
bracketIO :: IO v -> (v -> IO b) -> (v -> Annex a) -> Annex a
-bracketIO setup cleanup go = bracket (liftIO setup) (liftIO . cleanup) go
+bracketIO setup cleanup go = M.bracket (liftIO setup) (liftIO . cleanup) go
{- try in the Annex monad -}
tryAnnex :: Annex a -> Annex (Either SomeException a)
-tryAnnex = try
+tryAnnex = M.try
+
+{- throw in the Annex monad -}
+throwAnnex :: Exception e => e -> Annex a
+throwAnnex = M.throw
{- catch in the Annex monad -}
catchAnnex :: Exception e => Annex a -> (e -> Annex a) -> Annex a
-catchAnnex = catch
+catchAnnex = M.catch