summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-10-19 14:15:14 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2014-10-19 14:19:42 +0200
commitb5930f8b8030350eff306bf56ba7607098ada61e (patch)
tree29ba06c83156144c0082e8df9a7ccbb0a5f153b4 /libraries/base
parentd576fc38d9493c4979217fa36565f1f97fcc03d4 (diff)
downloadhaskell-b5930f8b8030350eff306bf56ba7607098ada61e.tar.gz
Refactor module imports in base
This commit removes a couple of {-# OPTIONS_GHC -fno-warn-unused-imports #-} by cleaning up the imports, as well as ensuring that all modules in the GHC.* hierarchy avoid importing the `Prelude` module to clean-up the import graph a bit.
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/Control/Concurrent.hs7
-rw-r--r--libraries/base/Data/Tuple.hs17
-rw-r--r--libraries/base/GHC/ConsoleHandler.hs4
-rw-r--r--libraries/base/GHC/Constants.hs2
-rw-r--r--libraries/base/GHC/Environment.hs6
-rw-r--r--libraries/base/GHC/Event.hs1
-rw-r--r--libraries/base/GHC/Int.hs1
-rw-r--r--libraries/base/GHC/PArr.hs1
-rw-r--r--libraries/base/GHC/Profiling.hs4
-rw-r--r--libraries/base/GHC/Stats.hsc6
-rw-r--r--libraries/base/GHC/TopHandler.lhs8
-rw-r--r--libraries/base/GHC/Word.hs1
12 files changed, 29 insertions, 29 deletions
diff --git a/libraries/base/Control/Concurrent.hs b/libraries/base/Control/Concurrent.hs
index c12fef54b0..702d0bb3b4 100644
--- a/libraries/base/Control/Concurrent.hs
+++ b/libraries/base/Control/Concurrent.hs
@@ -4,7 +4,6 @@
, UnboxedTuples
, ScopedTypeVariables
#-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
-- kludge for the Control.Concurrent.QSem, Control.Concurrent.QSemN
-- and Control.Concurrent.SampleVar imports.
@@ -106,11 +105,9 @@ module Control.Concurrent (
import Control.Exception.Base as Exception
-import GHC.Exception
import GHC.Conc hiding (threadWaitRead, threadWaitWrite,
threadWaitReadSTM, threadWaitWriteSTM)
-import qualified GHC.Conc
-import GHC.IO ( IO(..), unsafeInterleaveIO, unsafeUnmask )
+import GHC.IO ( unsafeUnmask )
import GHC.IORef ( newIORef, readIORef, writeIORef )
import GHC.Base
@@ -122,6 +119,8 @@ import Foreign.C.Types
import Foreign.C
import System.IO
import Data.Functor ( void )
+#else
+import qualified GHC.Conc
#endif
import Control.Concurrent.MVar
diff --git a/libraries/base/Data/Tuple.hs b/libraries/base/Data/Tuple.hs
index ec8478a6ff..d8bccf3364 100644
--- a/libraries/base/Data/Tuple.hs
+++ b/libraries/base/Data/Tuple.hs
@@ -1,7 +1,5 @@
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
--- XXX -fno-warn-unused-imports needed for the GHC.Tuple import below. Sigh.
-----------------------------------------------------------------------------
-- |
@@ -23,20 +21,9 @@ module Data.Tuple
, curry
, uncurry
, swap
- )
- where
+ ) where
-import GHC.Base
--- We need to depend on GHC.Base so that
--- a) so that we get GHC.Classes, GHC.Types
-
--- b) so that GHC.Base.inline is available, which is used
--- when expanding instance declarations
-
-import GHC.Tuple
--- We must import GHC.Tuple, to ensure sure that the
--- data constructors of `(,)' are in scope when we do
--- the standalone deriving instance for Eq (a,b) etc
+import GHC.Base () -- Note [Depend on GHC.Tuple]
default () -- Double isn't available yet
diff --git a/libraries/base/GHC/ConsoleHandler.hs b/libraries/base/GHC/ConsoleHandler.hs
index 4eaa434186..9c3ed9eb5b 100644
--- a/libraries/base/GHC/ConsoleHandler.hs
+++ b/libraries/base/GHC/ConsoleHandler.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP #-}
@@ -20,6 +21,8 @@
module GHC.ConsoleHandler
#if !defined(mingw32_HOST_OS) && !defined(__HADDOCK__)
where
+
+import GHC.Base () -- dummy dependency
#else /* whole file */
( Handler(..)
, installHandler
@@ -38,6 +41,7 @@ Note: this #include is inside a Haskell comment
by GHC
-}
+import GHC.Base
import Foreign
import Foreign.C
import GHC.IO.FD
diff --git a/libraries/base/GHC/Constants.hs b/libraries/base/GHC/Constants.hs
index c2e01a3e62..32bbf01747 100644
--- a/libraries/base/GHC/Constants.hs
+++ b/libraries/base/GHC/Constants.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
module GHC.Constants where
@@ -6,3 +7,4 @@ module GHC.Constants where
-- We probably want to include the constants in platformConstants somehow
-- instead.
+import GHC.Base () -- dummy dependency
diff --git a/libraries/base/GHC/Environment.hs b/libraries/base/GHC/Environment.hs
index 39b472913a..f5f5629ffa 100644
--- a/libraries/base/GHC/Environment.hs
+++ b/libraries/base/GHC/Environment.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP #-}
@@ -5,6 +6,8 @@ module GHC.Environment (getFullArgs) where
import Foreign
import Foreign.C
+import GHC.Base
+import GHC.Real ( fromIntegral )
#ifdef mingw32_HOST_OS
import GHC.IO (finally)
@@ -40,9 +43,8 @@ foreign import WINDOWS_CCONV unsafe "windows.h CommandLineToArgvW"
foreign import WINDOWS_CCONV unsafe "Windows.h LocalFree"
c_LocalFree :: Ptr a -> IO (Ptr a)
#else
-import Control.Monad
-
import GHC.IO.Encoding
+import GHC.Num
import qualified GHC.Foreign as GHC
getFullArgs :: IO [String]
diff --git a/libraries/base/GHC/Event.hs b/libraries/base/GHC/Event.hs
index 9746bc7f2e..3dcf3098b4 100644
--- a/libraries/base/GHC/Event.hs
+++ b/libraries/base/GHC/Event.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
-- ----------------------------------------------------------------------------
diff --git a/libraries/base/GHC/Int.hs b/libraries/base/GHC/Int.hs
index b8e05e2c5b..5cb6ceb7ff 100644
--- a/libraries/base/GHC/Int.hs
+++ b/libraries/base/GHC/Int.hs
@@ -39,7 +39,6 @@ import GHC.Read
import GHC.Arr
import GHC.Word hiding (uncheckedShiftL64#, uncheckedShiftRL64#)
import GHC.Show
-import GHC.Float () -- for RealFrac methods
import Data.Typeable
diff --git a/libraries/base/GHC/PArr.hs b/libraries/base/GHC/PArr.hs
index d569acab28..e15e87ea17 100644
--- a/libraries/base/GHC/PArr.hs
+++ b/libraries/base/GHC/PArr.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE ParallelArrays, MagicHash #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
diff --git a/libraries/base/GHC/Profiling.hs b/libraries/base/GHC/Profiling.hs
index c0322187cb..0bedcb18fa 100644
--- a/libraries/base/GHC/Profiling.hs
+++ b/libraries/base/GHC/Profiling.hs
@@ -1,5 +1,9 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
-- | /Since: 4.7.0.0/
module GHC.Profiling where
+import GHC.Base
+
foreign import ccall startProfTimer :: IO ()
foreign import ccall stopProfTimer :: IO ()
diff --git a/libraries/base/GHC/Stats.hsc b/libraries/base/GHC/Stats.hsc
index 11e31b9821..1a895b5815 100644
--- a/libraries/base/GHC/Stats.hsc
+++ b/libraries/base/GHC/Stats.hsc
@@ -1,4 +1,5 @@
-{-# LANGUAGE Safe #-}
+{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
@@ -19,6 +20,9 @@ module GHC.Stats
import Control.Monad
import Data.Int
+import GHC.Base
+import GHC.Read ( Read )
+import GHC.Show ( Show )
import GHC.IO.Exception
import Foreign.Marshal.Alloc
import Foreign.Storable
diff --git a/libraries/base/GHC/TopHandler.lhs b/libraries/base/GHC/TopHandler.lhs
index ee8e792e26..cdca26205c 100644
--- a/libraries/base/GHC/TopHandler.lhs
+++ b/libraries/base/GHC/TopHandler.lhs
@@ -5,7 +5,6 @@
, MagicHash
, UnboxedTuples
#-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
@@ -34,23 +33,22 @@ module GHC.TopHandler (
import Control.Exception
import Data.Maybe
-import Data.Dynamic (toDyn)
import Foreign
import Foreign.C
import GHC.Base
import GHC.Conc hiding (throwTo)
-import GHC.Num
import GHC.Real
-import GHC.MVar
import GHC.IO
import GHC.IO.Handle.FD
import GHC.IO.Handle
import GHC.IO.Exception
import GHC.Weak
-import Data.Typeable
+
#if defined(mingw32_HOST_OS)
import GHC.ConsoleHandler
+#else
+import Data.Dynamic (toDyn)
#endif
-- | 'runMainIO' is wrapped around 'Main.main' (or whatever main is
diff --git a/libraries/base/GHC/Word.hs b/libraries/base/GHC/Word.hs
index b2c70a2dcd..5351c0b94d 100644
--- a/libraries/base/GHC/Word.hs
+++ b/libraries/base/GHC/Word.hs
@@ -42,7 +42,6 @@ import GHC.Real
import GHC.Read
import GHC.Arr
import GHC.Show
-import GHC.Float () -- for RealFrac methods
------------------------------------------------------------------------
-- type Word8