summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ben Gamari <bgamari.foss@gmail.com>2014-05-28 17:01:57 -0400
committerGravatar Ben Gamari <bgamari.foss@gmail.com>2014-05-28 17:03:40 -0400
commit3e54d84fb90dac70b03360cf3259482e4ec16309 (patch)
treebb9d4e2af7c3914e93eec1a946f2d40c94c32882
parentac63e885d9dcb84a8d989452ef232827eeb86ddc (diff)
Use exceptions in place of deprecated MonadCatchIO-transformers
-rw-r--r--Annex.hs6
-rw-r--r--Annex/Exception.hs4
-rw-r--r--git-annex.cabal2
3 files changed, 7 insertions, 5 deletions
diff --git a/Annex.hs b/Annex.hs
index 4cad1d5e2..9ecb914cb 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -33,7 +33,7 @@ module Annex (
) where
import "mtl" Control.Monad.Reader
-import "MonadCatchIO-transformers" Control.Monad.CatchIO
+import Control.Monad.Catch
import Control.Concurrent
import Common
@@ -77,7 +77,9 @@ newtype Annex a = Annex { runAnnex :: ReaderT (MVar AnnexState) IO a }
Monad,
MonadIO,
MonadReader (MVar AnnexState),
- MonadCatchIO,
+ MonadCatch,
+ MonadThrow,
+ MonadMask,
Functor,
Applicative
)
diff --git a/Annex/Exception.hs b/Annex/Exception.hs
index 11613d51b..41a9ed921 100644
--- a/Annex/Exception.hs
+++ b/Annex/Exception.hs
@@ -21,7 +21,7 @@ module Annex.Exception (
catchAnnex,
) where
-import qualified "MonadCatchIO-transformers" Control.Monad.CatchIO as M
+import qualified Control.Monad.Catch as M
import Control.Exception
import Common.Annex
@@ -43,7 +43,7 @@ tryAnnexIO = M.try
{- throw in the Annex monad -}
throwAnnex :: Exception e => e -> Annex a
-throwAnnex = M.throw
+throwAnnex = M.throwM
{- catch in the Annex monad -}
catchAnnex :: Exception e => Annex a -> (e -> Annex a) -> Annex a
diff --git a/git-annex.cabal b/git-annex.cabal
index 22c103222..0de58f81b 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -98,7 +98,7 @@ Executable git-annex
containers, utf8-string, network (>= 2.0), mtl (>= 2),
bytestring, old-locale, time, HTTP,
extensible-exceptions, dataenc, SHA, process, json,
- base (>= 4.5 && < 4.9), monad-control, MonadCatchIO-transformers,
+ base (>= 4.5 && < 4.9), monad-control, exceptions,
IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process,
SafeSemaphore, uuid, random, dlist, unix-compat, async, stm (>= 2.3),
data-default, case-insensitive