Commit 80cfe711 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Merge pull request #1508 from benmachine/nocompat

Remove Distribution.Client.Compat.Exception
parents abed563e 9db7db03
{-# LANGUAGE CPP #-}
module Distribution.Client.Compat.Exception (
mask,
mask_
) where
-- We can't move these functions to Distribution.Compat.Exception because the
-- usage of the MIN_VERSION_base macro breaks bootstrapping.
#if MIN_VERSION_base(4,3,0)
-- it's much less of a headache if we re-export the "real" mask and mask_
-- so there's never more than one definition to conflict
import Control.Exception (mask, mask_)
#else
import Control.Exception (block, unblock)
#endif
#if !MIN_VERSION_base(4,3,0)
-- note: less polymorphic than 'real' mask, to avoid RankNTypes
-- we don't need the full generality where we use it
mask :: ((IO a -> IO a) -> IO b) -> IO b
mask handler = block (handler unblock)
mask_ :: IO a -> IO a
mask_ = block
#endif
......@@ -9,12 +9,10 @@ module Distribution.Client.Compat.Semaphore
import Control.Concurrent.STM (TVar, atomically, newTVar, readTVar, retry,
writeTVar)
import Control.Exception (onException)
import Control.Exception (mask_, onException)
import Control.Monad (join, when)
import Data.Typeable (Typeable)
import Distribution.Client.Compat.Exception (mask_)
-- | 'QSem' is a quantity semaphore in which the resource is aqcuired
-- and released in units of one. It provides guaranteed FIFO ordering
-- for satisfying blocked `waitQSem` calls.
......
......@@ -28,8 +28,7 @@ module Distribution.Client.JobControl (
import Control.Monad
import Control.Concurrent hiding (QSem, newQSem, waitQSem, signalQSem)
import Control.Exception (SomeException, bracket_, throw, try)
import Distribution.Client.Compat.Exception (mask)
import Control.Exception (SomeException, bracket_, mask, throw, try)
import Distribution.Client.Compat.Semaphore
data JobControl m a = JobControl {
......
......@@ -106,7 +106,6 @@ executable cabal
Distribution.Client.World
Distribution.Client.Win32SelfUpgrade
Distribution.Client.Compat.Environment
Distribution.Client.Compat.Exception
Distribution.Client.Compat.FilePerms
Distribution.Client.Compat.Semaphore
Distribution.Client.Compat.Time
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment