aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Utils.hs')
-rw-r--r--haddock-api/src/Haddock/Utils.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs
index 1d213420..0c9c6073 100644
--- a/haddock-api/src/Haddock/Utils.hs
+++ b/haddock-api/src/Haddock/Utils.hs
@@ -50,13 +50,12 @@ module Haddock.Utils (
import Documentation.Haddock.Doc (emptyMetaDoc)
import Haddock.Types
-import Haddock.GhcUtils
-import Exception (ExceptionMonad)
import GHC
-import Name
+import GHC.Types.Name
import Control.Monad.IO.Class ( MonadIO(..) )
+import Control.Monad.Catch ( MonadMask, bracket_ )
import Data.Char ( isAlpha, isAlphaNum, isAscii, ord, chr )
import Numeric ( showIntAtBase )
import Data.Map ( Map )
@@ -74,7 +73,6 @@ import qualified System.FilePath.Posix as HtmlPath
import qualified System.Posix.Internals
#endif
-
--------------------------------------------------------------------------------
-- * Logging
--------------------------------------------------------------------------------
@@ -278,9 +276,9 @@ writeUtf8File filepath contents = withFile filepath WriteMode $ \h -> do
hSetEncoding h utf8
hPutStr h contents
-withTempDir :: (ExceptionMonad m) => FilePath -> m a -> m a
-withTempDir dir = gbracket_ (liftIO $ createDirectory dir)
- (liftIO $ removeDirectoryRecursive dir)
+withTempDir :: (MonadIO m, MonadMask m) => FilePath -> m a -> m a
+withTempDir dir = bracket_ (liftIO $ createDirectory dir)
+ (liftIO $ removeDirectoryRecursive dir)
-----------------------------------------------------------------------------
-- * HTML cross references