aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--haddock-api/haddock-api.cabal1
-rw-r--r--haddock-api/src/Haddock/GhcUtils.hs5
-rw-r--r--haddock-api/src/Haddock/Utils.hs3
-rw-r--r--haddock.cabal1
4 files changed, 4 insertions, 6 deletions
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index 2c892de6..750f15a6 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -58,6 +58,7 @@ library
, containers
, deepseq
, directory
+ , exceptions
, filepath
, ghc-boot
, transformers
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs
index f8f6f838..b60b13a4 100644
--- a/haddock-api/src/Haddock/GhcUtils.hs
+++ b/haddock-api/src/Haddock/GhcUtils.hs
@@ -445,11 +445,6 @@ modifySessionDynFlags f = do
return ()
--- | A variant of 'gbracket' where the return value from the first computation
--- is not required.
-gbracket_ :: ExceptionMonad m => m a -> m b -> m c -> m c
-gbracket_ before_ after thing = gbracket before_ (const after) (const thing)
-
-- Extract the minimal complete definition of a Name, if one exists
minimalDef :: GhcMonad m => Name -> m (Maybe ClassMinimalDef)
minimalDef n = do
diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs
index 9bd0d656..010bd8bc 100644
--- a/haddock-api/src/Haddock/Utils.hs
+++ b/haddock-api/src/Haddock/Utils.hs
@@ -67,6 +67,7 @@ import GHC
import GHC.Types.Name
import Control.Monad ( liftM )
+import Control.Monad.Catch ( bracket_ )
import Data.Char ( isAlpha, isAlphaNum, isAscii, ord, chr )
import Numeric ( showIntAtBase )
import Data.Map ( Map )
@@ -404,7 +405,7 @@ writeUtf8File filepath contents = withFile filepath WriteMode $ \h -> do
hPutStr h contents
withTempDir :: (ExceptionMonad m) => FilePath -> m a -> m a
-withTempDir dir = gbracket_ (liftIO $ createDirectory dir)
+withTempDir dir = bracket_ (liftIO $ createDirectory dir)
(liftIO $ removeDirectoryRecursive dir)
-----------------------------------------------------------------------------
diff --git a/haddock.cabal b/haddock.cabal
index c8a3239e..e830d8fe 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -74,6 +74,7 @@ executable haddock
directory,
containers,
deepseq,
+ exceptions,
array,
xhtml >= 3000.2 && < 3000.3,
Cabal >= 1.10,