Trim imports, remove a cycle
authorsimonpj@microsoft <unknown>
Thu, 3 May 2007 12:30:10 +0000 (12:30 +0000)
committersimonpj@microsoft <unknown>
Thu, 3 May 2007 12:30:10 +0000 (12:30 +0000)
A first attempt at removing gratuitous cycles in the base package.
I've removed the useless module GHC.Dynamic, which gets rid of a cycle;
and trimmed off various unnecesary imports.

This also fixes the IsString import problem.

13 files changed:
Data/Typeable.hs
Data/Typeable.hs-boot
Foreign/Ptr.hs
Foreign/StablePtr.hs
Foreign/Storable.hs
Foreign/Storable.hs-boot
GHC/Dynamic.hs [deleted file]
GHC/Dynamic.hs-boot [deleted file]
GHC/Exts.hs
GHC/ForeignPtr.hs
GHC/IOBase.lhs
GHC/Storable.lhs
base.cabal

index d187296..7a8b733 100644 (file)
@@ -40,6 +40,7 @@ module Data.Typeable
        -- * Type representations
        TypeRep,        -- abstract, instance of: Eq, Show, Typeable
        TyCon,          -- abstract, instance of: Eq, Show, Typeable
+       showsTypeRep,
 
        -- * Construction of type representations
        mkTyCon,        -- :: String  -> TyCon
@@ -280,6 +281,9 @@ instance Show TypeRep where
            showChar ' '      . 
            showArgs tys
 
+showsTypeRep :: TypeRep -> ShowS
+showsTypeRep = shows
+
 instance Show TyCon where
   showsPrec _ (TyCon _ s) = showString s
 
index 5a2989c..d9bc373 100644 (file)
@@ -4,12 +4,14 @@
 module Data.Typeable where
 
 import GHC.Base
+import GHC.Show
 
 data TypeRep
 data TyCon
 
-mkTyCon :: String -> TyCon
-mkTyConApp :: TyCon -> [TypeRep] -> TypeRep
+mkTyCon      :: String -> TyCon
+mkTyConApp   :: TyCon -> [TypeRep] -> TypeRep
+showsTypeRep :: TypeRep -> ShowS
 
 class Typeable a where
   typeOf :: a -> TypeRep
index 6467c38..23706a8 100644 (file)
@@ -65,7 +65,6 @@ import Data.Word
 import Foreign.C.Types
 #endif
 
-import Control.Monad   ( liftM )
 import Data.Bits
 import Data.Typeable   ( Typeable(..), mkTyCon, mkTyConApp )
 import Foreign.Storable ( Storable(..) )
index 9554060..8ebdcfe 100644 (file)
@@ -30,7 +30,6 @@ module Foreign.StablePtr
 
 #ifdef __GLASGOW_HASKELL__
 import GHC.Stable
-import GHC.Err
 #endif
 
 #ifdef __HUGS__
index c48746b..3f05449 100644 (file)
@@ -45,7 +45,6 @@ import GHC.Stable     ( StablePtr )
 import GHC.Num
 import GHC.Int
 import GHC.Word
-import GHC.Stable
 import GHC.Ptr
 import GHC.Float
 import GHC.Err
index 12d256c..35374b5 100644 (file)
@@ -5,7 +5,6 @@ module Foreign.Storable where
 
 import GHC.Float
 import GHC.Int
-import GHC.Num
 import GHC.Word
 
 class Storable a
diff --git a/GHC/Dynamic.hs b/GHC/Dynamic.hs
deleted file mode 100644 (file)
index e86b027..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{-# OPTIONS -fno-implicit-prelude #-}
-module GHC.Dynamic (
-       Dynamic, TypeRep, dynTypeRep, showsTypeRep
-  ) where
-
-import Data.Dynamic    ( Dynamic, dynTypeRep )
-import Data.Typeable   ( TypeRep )
-import GHC.Show ( ShowS, shows )
-
-showsTypeRep :: TypeRep -> ShowS
-showsTypeRep = shows
diff --git a/GHC/Dynamic.hs-boot b/GHC/Dynamic.hs-boot
deleted file mode 100644 (file)
index a926421..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{-# OPTIONS -fno-implicit-prelude #-}
-module GHC.Dynamic (
-       Dynamic, TypeRep, dynTypeRep, showsTypeRep
-  ) where
-
-import {-# SOURCE #-} Data.Dynamic     ( Dynamic, dynTypeRep )
-import {-# SOURCE #-} Data.Typeable    ( TypeRep )
-import GHC.Show                ( ShowS )
-
-showsTypeRep :: TypeRep -> ShowS
index 5205456..d4e3856 100644 (file)
@@ -44,4 +44,5 @@ import GHC.Word
 import GHC.Num
 import GHC.Float
 import GHC.Ptr
+import Data.String
 
index bb74f0b..dc1f02f 100644 (file)
@@ -34,15 +34,13 @@ module GHC.ForeignPtr
 
 import Control.Monad   ( sequence_ )
 import Foreign.Storable
-import Numeric         ( showHex )
 
 import GHC.Show
-import GHC.Num
-import GHC.List        ( null, replicate, length )
+import GHC.List        ( null )
 import GHC.Base
 import GHC.IOBase
 import GHC.STRef       ( STRef(..) )
-import GHC.Ptr         ( Ptr(..), FunPtr, castFunPtrToPtr )
+import GHC.Ptr         ( Ptr(..), FunPtr )
 import GHC.Err
 
 -- |The type 'ForeignPtr' represents references to objects that are
index 1dee45f..32c7941 100644 (file)
@@ -58,7 +58,8 @@ import GHC.Read
 import Foreign.C.Types (CInt)
 
 #ifndef __HADDOCK__
-import {-# SOURCE #-} GHC.Dynamic
+import {-# SOURCE #-} Data.Typeable    ( showsTypeRep )
+import {-# SOURCE #-} Data.Dynamic     ( Dynamic, dynTypeRep )
 #endif
 
 -- ---------------------------------------------------------------------------
index 3a53f4b..de7cf67 100644 (file)
@@ -50,10 +50,9 @@ module GHC.Storable
        , writeWord64OffPtr   
         ) where
 
-import GHC.Stable      ( StablePtr )
+import GHC.Stable      ( StablePtr(..) )
 import GHC.Int
 import GHC.Word
-import GHC.Stable
 import GHC.Ptr
 import GHC.Float
 import GHC.IOBase
index 2153529..f4fd2fe 100644 (file)
@@ -107,7 +107,6 @@ exposed-modules:
        GHC.Conc,
        GHC.ConsoleHandler,
        GHC.Dotnet,
-       GHC.Dynamic,
        GHC.Enum,
        GHC.Err,
        GHC.Exception,