[commit: ghc] master: base: Add references to Notes for certain special imports (a811d93)

git at git.haskell.org git at git.haskell.org
Wed Sep 5 11:41:46 UTC 2018


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

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

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

commit a811d938acb09b23b11173842143a0fa946bf5cc
Author: Chaitanya Koparkar <ckoparkar at gmail.com>
Date:   Wed Sep 5 13:41:24 2018 +0200

    base: Add references to Notes for certain special imports
    
    Summary:
    Modules like GHC.Integer, GHC.Natural etc. are special and sometimes
    have to be imported just to resolve build ordering issues. It's useful
    to refer to the appropriate Notes at such import sites.
    
    Test Plan: Read it.
    
    Reviewers: RyanGlScott, bgamari, hvr, simonpj
    
    Reviewed By: RyanGlScott, simonpj
    
    Subscribers: simonpj, rwbarton, carter
    
    GHC Trac Issues: #15526
    
    Differential Revision: https://phabricator.haskell.org/D5092


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

a811d938acb09b23b11173842143a0fa946bf5cc
 libraries/base/Data/Semigroup/Internal.hs-boot | 2 +-
 libraries/base/GHC/Err.hs                      | 4 +++-
 libraries/base/GHC/IO.hs-boot                  | 2 +-
 libraries/base/GHC/Maybe.hs                    | 2 +-
 libraries/base/GHC/Stack/Types.hs              | 6 +++---
 libraries/base/Unsafe/Coerce.hs                | 4 ++--
 6 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/libraries/base/Data/Semigroup/Internal.hs-boot b/libraries/base/Data/Semigroup/Internal.hs-boot
index 8075024..3624929 100644
--- a/libraries/base/Data/Semigroup/Internal.hs-boot
+++ b/libraries/base/Data/Semigroup/Internal.hs-boot
@@ -4,7 +4,7 @@ module Data.Semigroup.Internal where
 
 import {-# SOURCE #-} GHC.Real (Integral)
 import {-# SOURCE #-} GHC.Base (Semigroup,Monoid,Maybe)
-import GHC.Integer ()   -- Note [Depend on GHC.Integer]
+import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base
 
 stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
 
diff --git a/libraries/base/GHC/Err.hs b/libraries/base/GHC/Err.hs
index 1f1ad90..095ccd8 100644
--- a/libraries/base/GHC/Err.hs
+++ b/libraries/base/GHC/Err.hs
@@ -29,7 +29,9 @@ import GHC.Stack.Types
 import GHC.Prim
 import GHC.Integer ()   -- Make sure Integer and Natural are compiled first
 import GHC.Natural ()   -- because GHC depends on it in a wired-in way
-                        -- so the build system doesn't see the dependency
+                        -- so the build system doesn't see the dependency.
+                        -- See Note [Depend on GHC.Integer] and
+                        -- Note [Depend on GHC.Natural] in GHC.Base.
 import {-# SOURCE #-} GHC.Exception
   ( errorCallWithCallStackException
   , errorCallException )
diff --git a/libraries/base/GHC/IO.hs-boot b/libraries/base/GHC/IO.hs-boot
index f1e50fe..aa2e5cc 100644
--- a/libraries/base/GHC/IO.hs-boot
+++ b/libraries/base/GHC/IO.hs-boot
@@ -4,7 +4,7 @@
 module GHC.IO where
 
 import GHC.Types
-import GHC.Integer () -- see Note [Depend upon GHC.Integer] in libraries/base/GHC/Base.hs
+import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base
 
 failIO :: [Char] -> IO a
 mplusIO :: IO a -> IO a -> IO a
diff --git a/libraries/base/GHC/Maybe.hs b/libraries/base/GHC/Maybe.hs
index 373fd48..2bdfac5 100644
--- a/libraries/base/GHC/Maybe.hs
+++ b/libraries/base/GHC/Maybe.hs
@@ -6,7 +6,7 @@ module GHC.Maybe
    )
 where
 
-import GHC.Integer () -- for build order
+import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base
 import GHC.Classes
 
 default ()
diff --git a/libraries/base/GHC/Stack/Types.hs b/libraries/base/GHC/Stack/Types.hs
index 4c8a106..45b1121 100644
--- a/libraries/base/GHC/Stack/Types.hs
+++ b/libraries/base/GHC/Stack/Types.hs
@@ -51,9 +51,9 @@ import GHC.Classes (Eq)
 import GHC.Types (Char, Int)
 
 -- Make implicit dependency known to build system
-import GHC.Tuple ()
-import GHC.Integer ()
-import GHC.Natural ()
+import GHC.Tuple ()   -- See Note [Depend on GHC.Tuple] in GHC.Base
+import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base
+import GHC.Natural () -- See Note [Depend on GHC.Natural] in GHC.Base
 
 ----------------------------------------------------------------------
 -- Explicit call-stacks built via ImplicitParams
diff --git a/libraries/base/Unsafe/Coerce.hs b/libraries/base/Unsafe/Coerce.hs
index d9a7977..5bcbb01 100644
--- a/libraries/base/Unsafe/Coerce.hs
+++ b/libraries/base/Unsafe/Coerce.hs
@@ -31,8 +31,8 @@
 
 module Unsafe.Coerce (unsafeCoerce) where
 
-import GHC.Integer () -- for build ordering
-import GHC.Natural () -- for build ordering
+import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base
+import GHC.Natural () -- See Note [Depend on GHC.Natural] in GHC.Base
 import GHC.Prim (unsafeCoerce#)
 
 local_id :: a -> a



More information about the ghc-commits mailing list