From ca3836e1b4a904feda0369a0cbec72735cf6e3a1 Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Wed, 21 Feb 2024 18:51:53 -0500
Subject: [PATCH] base: Migrate Haddock `not-home` pragmas from `ghc-internal`

This ensures that we do not use `base` stub modules as declarations'
homes when not appropriate.
---
 libraries/base/src/GHC/Arr.hs                   | 4 +++-
 libraries/base/src/GHC/Base.hs                  | 2 ++
 libraries/base/src/GHC/Bits.hs                  | 3 ++-
 libraries/base/src/GHC/Conc/IO.hs               | 4 +++-
 libraries/base/src/GHC/Conc/POSIX.hs            | 2 ++
 libraries/base/src/GHC/Conc/Sync.hs             | 1 +
 libraries/base/src/GHC/Desugar.hs               | 3 ++-
 libraries/base/src/GHC/Enum.hs                  | 1 +
 libraries/base/src/GHC/Err.hs                   | 1 +
 libraries/base/src/GHC/Exception.hs             | 1 +
 libraries/base/src/GHC/Exception/Type.hs        | 1 +
 libraries/base/src/GHC/Float.hs                 | 1 +
 libraries/base/src/GHC/Float/ConversionUtils.hs | 2 +-
 libraries/base/src/GHC/Float/RealFracMethods.hs | 3 ++-
 libraries/base/src/GHC/GHCi.hs                  | 2 ++
 libraries/base/src/GHC/IO.hs                    | 2 ++
 libraries/base/src/GHC/IO/Encoding/Iconv.hs     | 1 +
 libraries/base/src/GHC/IO/Exception.hs          | 1 +
 libraries/base/src/GHC/IO/FD.hs                 | 3 ++-
 libraries/base/src/GHC/IO/Handle/Internals.hs   | 3 ++-
 libraries/base/src/GHC/IO/Handle/Text.hs        | 1 -
 libraries/base/src/GHC/IO/Handle/Types.hs       | 1 +
 libraries/base/src/GHC/IO/IOMode.hs             | 3 ++-
 libraries/base/src/GHC/IO/Unsafe.hs             | 4 +++-
 libraries/base/src/GHC/IOArray.hs               | 4 +++-
 libraries/base/src/GHC/IORef.hs                 | 4 +++-
 libraries/base/src/GHC/Int.hs                   | 1 +
 libraries/base/src/GHC/Integer.hs               | 1 +
 libraries/base/src/GHC/Ix.hs                    | 4 +++-
 libraries/base/src/GHC/MVar.hs                  | 4 +++-
 libraries/base/src/GHC/Maybe.hs                 | 2 ++
 libraries/base/src/GHC/Natural.hs               | 1 +
 libraries/base/src/GHC/Num.hs                   | 2 ++
 libraries/base/src/GHC/Pack.hs                  | 1 +
 libraries/base/src/GHC/Ptr.hs                   | 2 ++
 libraries/base/src/GHC/Read.hs                  | 1 -
 libraries/base/src/GHC/Real.hs                  | 1 -
 libraries/base/src/GHC/ST.hs                    | 4 +++-
 libraries/base/src/GHC/STRef.hs                 | 4 +++-
 libraries/base/src/GHC/Show.hs                  | 1 -
 libraries/base/src/GHC/Stack/Types.hs           | 3 ++-
 libraries/base/src/GHC/Storable.hs              | 3 ++-
 libraries/base/src/GHC/TopHandler.hs            | 3 ++-
 libraries/base/src/GHC/TypeError.hs             | 1 +
 libraries/base/src/GHC/TypeLits/Internal.hs     | 3 ++-
 libraries/base/src/GHC/TypeNats/Internal.hs     | 3 ++-
 libraries/base/src/GHC/Unicode.hs               | 3 ++-
 libraries/base/src/GHC/Weak.hs                  | 2 ++
 libraries/base/src/GHC/Word.hs                  | 1 +
 libraries/base/src/System/Posix/Internals.hs    | 1 +
 libraries/ghc-internal/src/GHC/Internal/Ix.hs   | 1 -
 51 files changed, 84 insertions(+), 27 deletions(-)

diff --git a/libraries/base/src/GHC/Arr.hs b/libraries/base/src/GHC/Arr.hs
index 29bdb802e7e3..3578326774ac 100644
--- a/libraries/base/src/GHC/Arr.hs
+++ b/libraries/base/src/GHC/Arr.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.Arr
@@ -72,4 +74,4 @@ module GHC.Arr
      unsafeThawSTArray
      ) where
 
-import GHC.Internal.Arr
\ No newline at end of file
+import GHC.Internal.Arr
diff --git a/libraries/base/src/GHC/Base.hs b/libraries/base/src/GHC/Base.hs
index 6a28fea72d1a..4efeee521217 100644
--- a/libraries/base/src/GHC/Base.hs
+++ b/libraries/base/src/GHC/Base.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 -- Module      :  GHC.Base
 -- Copyright   :  (c) The University of Glasgow, 1992-2002
diff --git a/libraries/base/src/GHC/Bits.hs b/libraries/base/src/GHC/Bits.hs
index a7e11556e722..fd5a9f5da24a 100644
--- a/libraries/base/src/GHC/Bits.hs
+++ b/libraries/base/src/GHC/Bits.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -26,4 +27,4 @@ module GHC.Bits
      toIntegralSized
      ) where
 
-import GHC.Internal.Bits
\ No newline at end of file
+import GHC.Internal.Bits
diff --git a/libraries/base/src/GHC/Conc/IO.hs b/libraries/base/src/GHC/Conc/IO.hs
index a4f214a3b1cb..d91c423193e9 100644
--- a/libraries/base/src/GHC/Conc/IO.hs
+++ b/libraries/base/src/GHC/Conc/IO.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.Conc.IO
@@ -30,4 +32,4 @@ module GHC.Conc.IO
      closeFdWith
      ) where
 
-import GHC.Internal.Conc.IO
\ No newline at end of file
+import GHC.Internal.Conc.IO
diff --git a/libraries/base/src/GHC/Conc/POSIX.hs b/libraries/base/src/GHC/Conc/POSIX.hs
index d675c46076cc..2256a5f82ff7 100644
--- a/libraries/base/src/GHC/Conc/POSIX.hs
+++ b/libraries/base/src/GHC/Conc/POSIX.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 -- Module      :  GHC.Conc.POSIX
 -- Copyright   :  (c) The University of Glasgow, 1994-2002
diff --git a/libraries/base/src/GHC/Conc/Sync.hs b/libraries/base/src/GHC/Conc/Sync.hs
index 1d1f73533271..750a0b4d96f7 100644
--- a/libraries/base/src/GHC/Conc/Sync.hs
+++ b/libraries/base/src/GHC/Conc/Sync.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.Conc.Sync
diff --git a/libraries/base/src/GHC/Desugar.hs b/libraries/base/src/GHC/Desugar.hs
index d55eb629ffbd..9eebbfb81de7 100644
--- a/libraries/base/src/GHC/Desugar.hs
+++ b/libraries/base/src/GHC/Desugar.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -24,4 +25,4 @@ module GHC.Desugar
      toAnnotationWrapper
      ) where
 
-import GHC.Internal.Desugar
\ No newline at end of file
+import GHC.Internal.Desugar
diff --git a/libraries/base/src/GHC/Enum.hs b/libraries/base/src/GHC/Enum.hs
index 3a1479dc901c..1046bb6ae809 100644
--- a/libraries/base/src/GHC/Enum.hs
+++ b/libraries/base/src/GHC/Enum.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.Enum
diff --git a/libraries/base/src/GHC/Err.hs b/libraries/base/src/GHC/Err.hs
index 3d5374d95330..3f3abd2540ec 100644
--- a/libraries/base/src/GHC/Err.hs
+++ b/libraries/base/src/GHC/Err.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.Err
diff --git a/libraries/base/src/GHC/Exception.hs b/libraries/base/src/GHC/Exception.hs
index 72727a75a7f7..278bfc55f0e1 100644
--- a/libraries/base/src/GHC/Exception.hs
+++ b/libraries/base/src/GHC/Exception.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE Safe #-}
 {-# LANGUAGE PatternSynonyms #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.Exception
diff --git a/libraries/base/src/GHC/Exception/Type.hs b/libraries/base/src/GHC/Exception/Type.hs
index ff3bc8761955..537b83d2d877 100644
--- a/libraries/base/src/GHC/Exception/Type.hs
+++ b/libraries/base/src/GHC/Exception/Type.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.Exception.Type
diff --git a/libraries/base/src/GHC/Float.hs b/libraries/base/src/GHC/Float.hs
index 53ea4dd2b7cb..9cbfe5e7adc8 100644
--- a/libraries/base/src/GHC/Float.hs
+++ b/libraries/base/src/GHC/Float.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE Safe #-}
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
diff --git a/libraries/base/src/GHC/Float/ConversionUtils.hs b/libraries/base/src/GHC/Float/ConversionUtils.hs
index 42a5d139ca46..07563fef7473 100644
--- a/libraries/base/src/GHC/Float/ConversionUtils.hs
+++ b/libraries/base/src/GHC/Float/ConversionUtils.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE Safe #-}
-
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
diff --git a/libraries/base/src/GHC/Float/RealFracMethods.hs b/libraries/base/src/GHC/Float/RealFracMethods.hs
index 02579c9b999c..760a1dd03e7f 100644
--- a/libraries/base/src/GHC/Float/RealFracMethods.hs
+++ b/libraries/base/src/GHC/Float/RealFracMethods.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -54,4 +55,4 @@ module GHC.Float.RealFracMethods
      int2Float
      ) where
 
-import GHC.Internal.Float.RealFracMethods
\ No newline at end of file
+import GHC.Internal.Float.RealFracMethods
diff --git a/libraries/base/src/GHC/GHCi.hs b/libraries/base/src/GHC/GHCi.hs
index 2d2a86887467..27c1d34e2afa 100644
--- a/libraries/base/src/GHC/GHCi.hs
+++ b/libraries/base/src/GHC/GHCi.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.GHCi
diff --git a/libraries/base/src/GHC/IO.hs b/libraries/base/src/GHC/IO.hs
index 04548f6e0c8a..fbd427d02841 100644
--- a/libraries/base/src/GHC/IO.hs
+++ b/libraries/base/src/GHC/IO.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 -- Module      :  GHC.IO
 -- Copyright   :  (c) The University of Glasgow 1994-2023
diff --git a/libraries/base/src/GHC/IO/Encoding/Iconv.hs b/libraries/base/src/GHC/IO/Encoding/Iconv.hs
index 7b45a7b09be6..fff54a1172d5 100644
--- a/libraries/base/src/GHC/IO/Encoding/Iconv.hs
+++ b/libraries/base/src/GHC/IO/Encoding/Iconv.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE CPP #-}
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
diff --git a/libraries/base/src/GHC/IO/Exception.hs b/libraries/base/src/GHC/IO/Exception.hs
index 846f5804d9d9..4dcea7c22e29 100644
--- a/libraries/base/src/GHC/IO/Exception.hs
+++ b/libraries/base/src/GHC/IO/Exception.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.IO.Exception
diff --git a/libraries/base/src/GHC/IO/FD.hs b/libraries/base/src/GHC/IO/FD.hs
index 2bac2c8849a8..378802b6d58b 100644
--- a/libraries/base/src/GHC/IO/FD.hs
+++ b/libraries/base/src/GHC/IO/FD.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -28,4 +29,4 @@ module GHC.IO.FD
      stderr
      ) where
 
-import GHC.Internal.IO.FD
\ No newline at end of file
+import GHC.Internal.IO.FD
diff --git a/libraries/base/src/GHC/IO/Handle/Internals.hs b/libraries/base/src/GHC/IO/Handle/Internals.hs
index 72c89b340f85..040c4756d210 100644
--- a/libraries/base/src/GHC/IO/Handle/Internals.hs
+++ b/libraries/base/src/GHC/IO/Handle/Internals.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -68,4 +69,4 @@ module GHC.IO.Handle.Internals
      traceIO
      ) where
 
-import GHC.Internal.IO.Handle.Internals
\ No newline at end of file
+import GHC.Internal.IO.Handle.Internals
diff --git a/libraries/base/src/GHC/IO/Handle/Text.hs b/libraries/base/src/GHC/IO/Handle/Text.hs
index 099012b4c1d6..97ce3bea5293 100644
--- a/libraries/base/src/GHC/IO/Handle/Text.hs
+++ b/libraries/base/src/GHC/IO/Handle/Text.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE Safe #-}
-
 {-# OPTIONS_HADDOCK not-home #-}
 
 -- |
diff --git a/libraries/base/src/GHC/IO/Handle/Types.hs b/libraries/base/src/GHC/IO/Handle/Types.hs
index 36ef2308a7d6..55b899ef6be7 100644
--- a/libraries/base/src/GHC/IO/Handle/Types.hs
+++ b/libraries/base/src/GHC/IO/Handle/Types.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  GHC.IO.Handle.Types
diff --git a/libraries/base/src/GHC/IO/IOMode.hs b/libraries/base/src/GHC/IO/IOMode.hs
index f28893077d3a..44a931e4260d 100644
--- a/libraries/base/src/GHC/IO/IOMode.hs
+++ b/libraries/base/src/GHC/IO/IOMode.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -17,4 +18,4 @@ module GHC.IO.IOMode
     (IOMode(..)
      ) where
 
-import GHC.Internal.IO.IOMode
\ No newline at end of file
+import GHC.Internal.IO.IOMode
diff --git a/libraries/base/src/GHC/IO/Unsafe.hs b/libraries/base/src/GHC/IO/Unsafe.hs
index b3d89969723e..5e57797044b0 100644
--- a/libraries/base/src/GHC/IO/Unsafe.hs
+++ b/libraries/base/src/GHC/IO/Unsafe.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.IO.Unsafe
@@ -19,4 +21,4 @@ module GHC.IO.Unsafe
      noDuplicate
      ) where
 
-import GHC.Internal.IO.Unsafe
\ No newline at end of file
+import GHC.Internal.IO.Unsafe
diff --git a/libraries/base/src/GHC/IOArray.hs b/libraries/base/src/GHC/IOArray.hs
index fb82914473f5..781dbd628068 100644
--- a/libraries/base/src/GHC/IOArray.hs
+++ b/libraries/base/src/GHC/IOArray.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.IOArray
@@ -21,4 +23,4 @@ module GHC.IOArray
      boundsIOArray
      ) where
 
-import GHC.Internal.IOArray
\ No newline at end of file
+import GHC.Internal.IOArray
diff --git a/libraries/base/src/GHC/IORef.hs b/libraries/base/src/GHC/IORef.hs
index f6cd6c2c9ced..6eff5f8e45c0 100644
--- a/libraries/base/src/GHC/IORef.hs
+++ b/libraries/base/src/GHC/IORef.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.IORef
@@ -25,4 +27,4 @@ module GHC.IORef
      atomicModifyIORef'
      ) where
 
-import GHC.Internal.IORef
\ No newline at end of file
+import GHC.Internal.IORef
diff --git a/libraries/base/src/GHC/Int.hs b/libraries/base/src/GHC/Int.hs
index cee5f6999d3d..1cf122d763ee 100644
--- a/libraries/base/src/GHC/Int.hs
+++ b/libraries/base/src/GHC/Int.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE Safe #-}
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
diff --git a/libraries/base/src/GHC/Integer.hs b/libraries/base/src/GHC/Integer.hs
index ad8ac2f5432b..37efd33d7ff7 100644
--- a/libraries/base/src/GHC/Integer.hs
+++ b/libraries/base/src/GHC/Integer.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Compatibility module for pre-@ghc-bignum@ code.
diff --git a/libraries/base/src/GHC/Ix.hs b/libraries/base/src/GHC/Ix.hs
index 5b60bd296904..1e1e0589e18e 100644
--- a/libraries/base/src/GHC/Ix.hs
+++ b/libraries/base/src/GHC/Ix.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.Ix
@@ -16,4 +18,4 @@ module GHC.Ix
      indexError
      ) where
 
-import GHC.Internal.Ix
\ No newline at end of file
+import GHC.Internal.Ix
diff --git a/libraries/base/src/GHC/MVar.hs b/libraries/base/src/GHC/MVar.hs
index b1b768018797..3fe21bab7ae7 100644
--- a/libraries/base/src/GHC/MVar.hs
+++ b/libraries/base/src/GHC/MVar.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.MVar
@@ -26,4 +28,4 @@ module GHC.MVar
      addMVarFinalizer
      ) where
 
-import GHC.Internal.MVar
\ No newline at end of file
+import GHC.Internal.MVar
diff --git a/libraries/base/src/GHC/Maybe.hs b/libraries/base/src/GHC/Maybe.hs
index c47b0c2cfc0d..ea37f055e6d2 100644
--- a/libraries/base/src/GHC/Maybe.hs
+++ b/libraries/base/src/GHC/Maybe.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 -- Module      :  GHC.Maybe
 -- Copyright   :  (c) The University of Glasgow 1997-2002
diff --git a/libraries/base/src/GHC/Natural.hs b/libraries/base/src/GHC/Natural.hs
index dd6e4e91afde..86433c063a8f 100644
--- a/libraries/base/src/GHC/Natural.hs
+++ b/libraries/base/src/GHC/Natural.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE Safe #-}
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Compatibility module for pre ghc-bignum code.
diff --git a/libraries/base/src/GHC/Num.hs b/libraries/base/src/GHC/Num.hs
index 1219c4c1ca99..a68c4ea643b3 100644
--- a/libraries/base/src/GHC/Num.hs
+++ b/libraries/base/src/GHC/Num.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 -- Module      :  GHC.Num
 -- Copyright   :  (c) The University of Glasgow 1994-2002
diff --git a/libraries/base/src/GHC/Pack.hs b/libraries/base/src/GHC/Pack.hs
index 0a318290ba27..cff9e760810b 100644
--- a/libraries/base/src/GHC/Pack.hs
+++ b/libraries/base/src/GHC/Pack.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
diff --git a/libraries/base/src/GHC/Ptr.hs b/libraries/base/src/GHC/Ptr.hs
index 799859459363..084d32a7c65c 100644
--- a/libraries/base/src/GHC/Ptr.hs
+++ b/libraries/base/src/GHC/Ptr.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 -- Module      :  GHC.Ptr
 -- Copyright   :  (c) The FFI Task Force, 2000-2002
diff --git a/libraries/base/src/GHC/Read.hs b/libraries/base/src/GHC/Read.hs
index 0532ee81a0a9..4380100cdfa8 100644
--- a/libraries/base/src/GHC/Read.hs
+++ b/libraries/base/src/GHC/Read.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE Safe #-}
-
 {-# OPTIONS_HADDOCK not-home #-}
 
 -- |
diff --git a/libraries/base/src/GHC/Real.hs b/libraries/base/src/GHC/Real.hs
index dfa47bd83ec8..a563ebaf40a2 100644
--- a/libraries/base/src/GHC/Real.hs
+++ b/libraries/base/src/GHC/Real.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE Safe #-}
-
 {-# OPTIONS_HADDOCK not-home #-}
 
 -- |
diff --git a/libraries/base/src/GHC/ST.hs b/libraries/base/src/GHC/ST.hs
index 49f18da4bc46..bd0d5346e01f 100644
--- a/libraries/base/src/GHC/ST.hs
+++ b/libraries/base/src/GHC/ST.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.ST
@@ -22,4 +24,4 @@ module GHC.ST
      unsafeDupableInterleaveST
      ) where
 
-import GHC.Internal.ST
\ No newline at end of file
+import GHC.Internal.ST
diff --git a/libraries/base/src/GHC/STRef.hs b/libraries/base/src/GHC/STRef.hs
index e4ccdf078019..c44bac389f93 100644
--- a/libraries/base/src/GHC/STRef.hs
+++ b/libraries/base/src/GHC/STRef.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.STRef
@@ -18,4 +20,4 @@ module GHC.STRef
      writeSTRef
      ) where
 
-import GHC.Internal.STRef
\ No newline at end of file
+import GHC.Internal.STRef
diff --git a/libraries/base/src/GHC/Show.hs b/libraries/base/src/GHC/Show.hs
index 591a012670f1..d09557b0d69c 100644
--- a/libraries/base/src/GHC/Show.hs
+++ b/libraries/base/src/GHC/Show.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE Safe #-}
-
 {-# OPTIONS_HADDOCK not-home #-}
 
 -- |
diff --git a/libraries/base/src/GHC/Stack/Types.hs b/libraries/base/src/GHC/Stack/Types.hs
index 88a189cc63c7..592a53d3bebf 100644
--- a/libraries/base/src/GHC/Stack/Types.hs
+++ b/libraries/base/src/GHC/Stack/Types.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -33,4 +34,4 @@ module GHC.Stack.Types
      SrcLoc(..)
      ) where
 
-import GHC.Internal.Stack.Types
\ No newline at end of file
+import GHC.Internal.Stack.Types
diff --git a/libraries/base/src/GHC/Storable.hs b/libraries/base/src/GHC/Storable.hs
index 21a863777613..eae53963960e 100644
--- a/libraries/base/src/GHC/Storable.hs
+++ b/libraries/base/src/GHC/Storable.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -48,4 +49,4 @@ module GHC.Storable
      writeWord64OffPtr
      ) where
 
-import GHC.Internal.Storable
\ No newline at end of file
+import GHC.Internal.Storable
diff --git a/libraries/base/src/GHC/TopHandler.hs b/libraries/base/src/GHC/TopHandler.hs
index fb18f307bc92..b0b596067ade 100644
--- a/libraries/base/src/GHC/TopHandler.hs
+++ b/libraries/base/src/GHC/TopHandler.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -31,4 +32,4 @@ module GHC.TopHandler
      flushStdHandles
      ) where
 
-import GHC.Internal.TopHandler
\ No newline at end of file
+import GHC.Internal.TopHandler
diff --git a/libraries/base/src/GHC/TypeError.hs b/libraries/base/src/GHC/TypeError.hs
index a5ecaede4f69..0d19b5518524 100644
--- a/libraries/base/src/GHC/TypeError.hs
+++ b/libraries/base/src/GHC/TypeError.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 {-|
 This module exports:
diff --git a/libraries/base/src/GHC/TypeLits/Internal.hs b/libraries/base/src/GHC/TypeLits/Internal.hs
index 64793a5c34d4..034e453b220c 100644
--- a/libraries/base/src/GHC/TypeLits/Internal.hs
+++ b/libraries/base/src/GHC/TypeLits/Internal.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -31,4 +32,4 @@ module GHC.TypeLits.Internal
      CmpChar
      ) where
 
-import GHC.Internal.TypeLits.Internal
\ No newline at end of file
+import GHC.Internal.TypeLits.Internal
diff --git a/libraries/base/src/GHC/TypeNats/Internal.hs b/libraries/base/src/GHC/TypeNats/Internal.hs
index 43c5ba108d52..d2022c3bea33 100644
--- a/libraries/base/src/GHC/TypeNats/Internal.hs
+++ b/libraries/base/src/GHC/TypeNats/Internal.hs
@@ -1,8 +1,9 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 module GHC.TypeNats.Internal
     (Natural,
      CmpNat
      ) where
 
-import GHC.Internal.TypeNats.Internal
\ No newline at end of file
+import GHC.Internal.TypeNats.Internal
diff --git a/libraries/base/src/GHC/Unicode.hs b/libraries/base/src/GHC/Unicode.hs
index 1d4b9233a2d7..21709bf857b5 100644
--- a/libraries/base/src/GHC/Unicode.hs
+++ b/libraries/base/src/GHC/Unicode.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
@@ -42,4 +43,4 @@ module GHC.Unicode
      toTitle
      ) where
 
-import GHC.Internal.Unicode
\ No newline at end of file
+import GHC.Internal.Unicode
diff --git a/libraries/base/src/GHC/Weak.hs b/libraries/base/src/GHC/Weak.hs
index 046a7bd0a0dc..ec2c79f9e4dc 100644
--- a/libraries/base/src/GHC/Weak.hs
+++ b/libraries/base/src/GHC/Weak.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_HADDOCK not-home #-}
+
 -- |
 --
 -- Module      :  GHC.Weak
diff --git a/libraries/base/src/GHC/Word.hs b/libraries/base/src/GHC/Word.hs
index 7d807115cbda..66eeeed0f55b 100644
--- a/libraries/base/src/GHC/Word.hs
+++ b/libraries/base/src/GHC/Word.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE Safe #-}
 {-# LANGUAGE MagicHash #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 --
diff --git a/libraries/base/src/System/Posix/Internals.hs b/libraries/base/src/System/Posix/Internals.hs
index 51d3b2ed8d70..9323bcb829e4 100644
--- a/libraries/base/src/System/Posix/Internals.hs
+++ b/libraries/base/src/System/Posix/Internals.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE Safe #-}
+{-# OPTIONS_HADDOCK not-home #-}
 
 -- |
 -- Module      :  System.Posix.Internals
diff --git a/libraries/ghc-internal/src/GHC/Internal/Ix.hs b/libraries/ghc-internal/src/GHC/Internal/Ix.hs
index a676712cc62a..4e9deabe16d3 100644
--- a/libraries/ghc-internal/src/GHC/Internal/Ix.hs
+++ b/libraries/ghc-internal/src/GHC/Internal/Ix.hs
@@ -1,6 +1,5 @@
 {-# LANGUAGE MagicHash #-}
 {-# LANGUAGE NoImplicitPrelude #-}
-
 {-# OPTIONS_HADDOCK not-home #-}
 
 -----------------------------------------------------------------------------
-- 
GitLab