From c60995fe05d9cc267e892448604b8b96a705ccc7 Mon Sep 17 00:00:00 2001 From: Artem Pelenitsyn Date: Sun, 26 Apr 2020 04:14:29 +0200 Subject: add dependency on exceptions because GHC.Exception was boiled down (ghc #18075) --- haddock-api/src/Haddock/Utils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock/Utils.hs') 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) ----------------------------------------------------------------------------- -- cgit v1.2.3