[commit: ghc] master: Don't re-export `Alternative(..)` from Control.Monad (re #9586) (319703e)

git at git.haskell.org git at git.haskell.org
Fri Sep 26 19:12:30 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/319703ee0c97c593be514222fdee06555816cda4/ghc

>---------------------------------------------------------------

commit 319703ee0c97c593be514222fdee06555816cda4
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Sep 26 21:09:56 2014 +0200

    Don't re-export `Alternative(..)` from Control.Monad (re #9586)
    
    This was done in d94de87252d0fe2ae97341d186b03a2fbe136b04 to avoid orphans
    but since a94dc4c3067c6a0925e2e39f35ef0930771535f1 moved `Alternative`
    into GHC.Base, this isn't needed anymore.
    
    This is important, as otherwise this would require a non-neglectable amount
    of `Control.Monad hiding ((<|>), empty)` imports in user code.
    
    The Haddock submodule is updated as well
    
    Test Plan: partial local ./validate --fast, let Harbormaster doublecheck it
    
    Reviewed By: ekmett, austin
    
    Differential Revision: https://phabricator.haskell.org/D248


>---------------------------------------------------------------

319703ee0c97c593be514222fdee06555816cda4
 compiler/main/ErrUtils.lhs                        | 4 ----
 compiler/parser/RdrHsSyn.lhs                      | 4 ----
 compiler/prelude/PrelRules.lhs                    | 4 +++-
 compiler/typecheck/TcRnDriver.lhs                 | 4 ----
 compiler/utils/IOEnv.hs                           | 2 --
 ghc/InteractiveUI.hs                              | 2 +-
 libraries/base/Control/Monad.hs                   | 1 -
 testsuite/tests/typecheck/should_compile/T4524.hs | 3 ++-
 testsuite/tests/typecheck/should_compile/tc213.hs | 2 +-
 utils/haddock                                     | 2 +-
 10 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index b06f5bc..c43064e 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -55,11 +55,7 @@ import qualified Data.Set as Set
 import Data.IORef
 import Data.Ord
 import Data.Time
-#if __GLASGOW_HASKELL__ >= 709
-import Control.Monad hiding (empty)
-#else
 import Control.Monad
-#endif
 import Control.Monad.IO.Class
 import System.IO
 
diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs
index 6bd5d27..e6969e7 100644
--- a/compiler/parser/RdrHsSyn.lhs
+++ b/compiler/parser/RdrHsSyn.lhs
@@ -86,11 +86,7 @@ import Maybes
 import Util
 
 import Control.Applicative ((<$>))
-#if __GLASGOW_HASKELL__ >= 709
-import Control.Monad hiding (empty, many)
-#else
 import Control.Monad
-#endif
 
 import Text.ParserCombinators.ReadP as ReadP
 import Data.Char
diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs
index a91d3f7..1e5f259 100644
--- a/compiler/prelude/PrelRules.lhs
+++ b/compiler/prelude/PrelRules.lhs
@@ -48,7 +48,9 @@ import Platform
 import Util
 import Coercion     (mkUnbranchedAxInstCo,mkSymCo,Role(..))
 
-#if __GLASGOW_HASKELL__ < 709
+#if __GLASGOW_HASKELL__ >= 709
+import Control.Applicative ( Alternative(..) )
+#else
 import Control.Applicative ( Applicative(..), Alternative(..) )
 #endif
 
diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs
index 4927684..9898b46 100644
--- a/compiler/typecheck/TcRnDriver.lhs
+++ b/compiler/typecheck/TcRnDriver.lhs
@@ -100,11 +100,7 @@ import Maybes
 import Util
 import Bag
 
-#if __GLASGOW_HASKELL__ >= 709
-import Control.Monad hiding (empty)
-#else
 import Control.Monad
-#endif
 
 #include "HsVersions.h"
 \end{code}
diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs
index 8193beb..46f6e46 100644
--- a/compiler/utils/IOEnv.hs
+++ b/compiler/utils/IOEnv.hs
@@ -44,9 +44,7 @@ import System.IO.Unsafe ( unsafeInterleaveIO )
 import System.IO        ( fixIO )
 import Control.Monad
 import MonadUtils
-#if __GLASGOW_HASKELL__ < 709
 import Control.Applicative (Alternative(..))
-#endif
 
 ----------------------------------------------------------------------
 -- Defining the monad type
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 0bcecd3..3192d20 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -63,7 +63,7 @@ import Util
 -- Haskell Libraries
 import System.Console.Haskeline as Haskeline
 
-import Control.Monad as Monad hiding (empty)
+import Control.Monad as Monad
 
 import Control.Applicative hiding (empty)
 import Control.Monad.Trans.Class
diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs
index 889f91a..3fe4450 100644
--- a/libraries/base/Control/Monad.hs
+++ b/libraries/base/Control/Monad.hs
@@ -20,7 +20,6 @@ module Control.Monad
 
       Functor(fmap)
     , Monad((>>=), (>>), return, fail)
-    , Alternative(empty, (<|>), some, many)
     , MonadPlus(mzero, mplus)
     -- * Functions
 
diff --git a/testsuite/tests/typecheck/should_compile/T4524.hs b/testsuite/tests/typecheck/should_compile/T4524.hs
index 0b2e538..27cbb1f 100644
--- a/testsuite/tests/typecheck/should_compile/T4524.hs
+++ b/testsuite/tests/typecheck/should_compile/T4524.hs
@@ -28,7 +28,8 @@
 module T4524 where
 
 import Data.Maybe ( mapMaybe )
-import Control.Monad (Alternative(..), MonadPlus(..), msum, ap, liftM )
+import Control.Applicative ( Alternative(..) )
+import Control.Monad ( MonadPlus(..), msum, ap, liftM )
 import Unsafe.Coerce (unsafeCoerce)
 
 newtype FileName = FN FilePath deriving ( Eq, Ord )
diff --git a/testsuite/tests/typecheck/should_compile/tc213.hs b/testsuite/tests/typecheck/should_compile/tc213.hs
index 8034606..1f0b464 100644
--- a/testsuite/tests/typecheck/should_compile/tc213.hs
+++ b/testsuite/tests/typecheck/should_compile/tc213.hs
@@ -5,7 +5,7 @@
 -- type signature in t1 and t2
 
 module Foo7 where
-import Control.Monad hiding (empty)
+import Control.Monad
 import Control.Monad.ST
 import Data.Array.MArray
 import Data.Array.ST
diff --git a/utils/haddock b/utils/haddock
index 12dc730..a65d213 160000
--- a/utils/haddock
+++ b/utils/haddock
@@ -1 +1 @@
-Subproject commit 12dc730e62236e15f1194ddc8260affc24928bd1
+Subproject commit a65d2131647e010608d2a1956116a0012946838f



More information about the ghc-commits mailing list