From fb80d56c0b7617261c93a808e9001bbb25a7562e Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 1 Aug 2008 23:00:59 +0000 Subject: [PATCH] Remove unused imports --- Control/OldException.hs | 4 ++-- Data/Either.hs | 2 +- Foreign/C/Error.hs | 14 -------------- Foreign/Marshal/Alloc.hs | 5 ++++- Foreign/Marshal/Array.hs | 1 - GHC/Conc.lhs | 9 +++++---- GHC/Dotnet.hs | 4 ---- GHC/Err.lhs | 2 +- GHC/Exts.hs | 1 - GHC/Handle.hs | 2 -- GHC/IOBase.lhs | 4 ++-- GHC/PArr.hs | 2 +- GHC/Unicode.hs | 1 - Prelude.hs | 9 ++------- System/IO/Error.hs | 1 - 15 files changed, 18 insertions(+), 43 deletions(-) diff --git a/Control/OldException.hs b/Control/OldException.hs index 6014e1c..1b392d8 100644 --- a/Control/OldException.hs +++ b/Control/OldException.hs @@ -138,7 +138,6 @@ import GHC.IOBase ( IO ) import GHC.IOBase (block, unblock, evaluate, catchException, throwIO) import qualified GHC.IOBase as ExceptionBase import qualified GHC.IOBase as New -import GHC.Exception hiding ( Exception ) import GHC.Conc hiding (setUncaughtExceptionHandler, getUncaughtExceptionHandler) import Data.IORef ( IORef, newIORef, readIORef, writeIORef ) @@ -151,6 +150,7 @@ import Hugs.Exception as ExceptionBase #endif import qualified Control.Exception as New +import Control.Exception ( throw, SomeException ) import System.IO.Error hiding ( catch, try ) import System.IO.Unsafe (unsafePerformIO) import Data.Dynamic @@ -721,7 +721,7 @@ data Exception INSTANCE_TYPEABLE0(Exception,exceptionTc,"Exception") nonTermination :: SomeException -nonTermination = toException NonTermination +nonTermination = New.toException NonTermination -- For now at least, make the monolithic Exception type an instance of -- the Exception class diff --git a/Data/Either.hs b/Data/Either.hs index d22e91c..0bed290 100644 --- a/Data/Either.hs +++ b/Data/Either.hs @@ -21,7 +21,7 @@ module Data.Either ( partitionEithers, -- :: [Either a b] -> ([a],[b]) ) where -import Data.Tuple +import Data.Tuple () #ifdef __GLASGOW_HASKELL__ import GHC.Base diff --git a/Foreign/C/Error.hs b/Foreign/C/Error.hs index 0a4c90f..77d2738 100644 --- a/Foreign/C/Error.hs +++ b/Foreign/C/Error.hs @@ -101,20 +101,6 @@ module Foreign.C.Error ( #include "HsBaseConfig.h" #endif --- system dependent imports --- ------------------------ - --- GHC allows us to get at the guts inside IO errors/exceptions --- -#if __GLASGOW_HASKELL__ -import GHC.IOBase (IOException(..), IOErrorType(..)) -#endif /* __GLASGOW_HASKELL__ */ - - --- regular imports --- --------------- - -import Foreign.Storable import Foreign.Ptr import Foreign.C.Types import Foreign.C.String diff --git a/Foreign/Marshal/Alloc.hs b/Foreign/Marshal/Alloc.hs index c5ae6a9..220d02b 100644 --- a/Foreign/Marshal/Alloc.hs +++ b/Foreign/Marshal/Alloc.hs @@ -31,10 +31,13 @@ module Foreign.Marshal.Alloc ( ) where import Data.Maybe -import Foreign.Ptr ( Ptr, nullPtr, FunPtr ) import Foreign.C.Types ( CSize ) import Foreign.Storable ( Storable(sizeOf) ) +#ifndef __GLASGOW_HASKELL__ +import Foreign.Ptr ( Ptr, nullPtr, FunPtr ) +#endif + #ifdef __GLASGOW_HASKELL__ import Foreign.ForeignPtr ( FinalizerPtr ) import GHC.IOBase diff --git a/Foreign/Marshal/Array.hs b/Foreign/Marshal/Array.hs index fa23be9..a3d9d16 100644 --- a/Foreign/Marshal/Array.hs +++ b/Foreign/Marshal/Array.hs @@ -62,7 +62,6 @@ module Foreign.Marshal.Array ( advancePtr, -- :: Storable a => Ptr a -> Int -> Ptr a ) where -import Control.Monad import Foreign.Ptr (Ptr, plusPtr) import Foreign.Storable (Storable(sizeOf,peekElemOff,pokeElemOff)) import Foreign.Marshal.Alloc (mallocBytes, allocaBytes, reallocBytes) diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index c45d563..d47ba0b 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -114,9 +114,10 @@ import GHC.Base import {-# SOURCE #-} GHC.Handle import GHC.IOBase import GHC.Num ( Num(..) ) -import GHC.Real ( fromIntegral, div ) -#ifndef mingw32_HOST_OS -import GHC.Base ( Int(..) ) +import GHC.Real ( fromIntegral ) +#ifdef mingw32_HOST_OS +import GHC.Real ( div ) +import GHC.Ptr ( plusPtr, FunPtr(..) ) #endif #ifdef mingw32_HOST_OS import GHC.Read ( Read ) @@ -124,7 +125,7 @@ import GHC.Enum ( Enum ) #endif import GHC.Exception ( SomeException(..), throw ) import GHC.Pack ( packCString# ) -import GHC.Ptr ( Ptr(..), plusPtr, FunPtr(..) ) +import GHC.Ptr ( Ptr(..) ) import GHC.STRef import GHC.Show ( Show(..), showString ) import Data.Typeable diff --git a/GHC/Dotnet.hs b/GHC/Dotnet.hs index 01de3e9..1d62f72 100644 --- a/GHC/Dotnet.hs +++ b/GHC/Dotnet.hs @@ -22,15 +22,11 @@ module GHC.Dotnet , checkResult ) where -import GHC.Prim import GHC.Base import GHC.Exception -import GHC.IO import GHC.IOBase import GHC.Ptr -import Foreign.Marshal.Array import Foreign.Marshal.Alloc -import Foreign.Storable import Foreign.C.String data Object a diff --git a/GHC/Err.lhs b/GHC/Err.lhs index 071e9b6..b2bca94 100644 --- a/GHC/Err.lhs +++ b/GHC/Err.lhs @@ -35,7 +35,7 @@ module GHC.Err #ifndef __HADDOCK__ import GHC.Base import GHC.IOBase -import GHC.List ( span ) +import GHC.List () import GHC.Exception #endif \end{code} diff --git a/GHC/Exts.hs b/GHC/Exts.hs index 7dc604f..bc36771 100644 --- a/GHC/Exts.hs +++ b/GHC/Exts.hs @@ -51,7 +51,6 @@ import GHC.Prim import GHC.Base import GHC.Word import GHC.Int -import GHC.Num import GHC.Float import GHC.Ptr import Data.String diff --git a/GHC/Handle.hs b/GHC/Handle.hs index c33ddab..5cb0a40 100644 --- a/GHC/Handle.hs +++ b/GHC/Handle.hs @@ -58,7 +58,6 @@ module GHC.Handle ( ) where import Control.Monad -import Data.Bits import Data.Maybe import Foreign import Foreign.C @@ -77,7 +76,6 @@ import GHC.Exception import GHC.Enum import GHC.Num ( Integer(..), Num(..) ) import GHC.Show -import GHC.Real ( toInteger ) #if defined(DEBUG_DUMP) import GHC.Pack #endif diff --git a/GHC/IOBase.lhs b/GHC/IOBase.lhs index 399d8eb..ea4abf4 100644 --- a/GHC/IOBase.lhs +++ b/GHC/IOBase.lhs @@ -64,8 +64,8 @@ import Foreign.C.Types (CInt) import GHC.Exception #ifndef __HADDOCK__ -import {-# SOURCE #-} Data.Typeable ( Typeable, showsTypeRep ) -import {-# SOURCE #-} Data.Dynamic ( Dynamic, dynTypeRep ) +import {-# SOURCE #-} Data.Typeable ( Typeable ) +import {-# SOURCE #-} Data.Dynamic ( Dynamic ) #endif -- --------------------------------------------------------------------------- diff --git a/GHC/PArr.hs b/GHC/PArr.hs index 0ca8b66..9148301 100644 --- a/GHC/PArr.hs +++ b/GHC/PArr.hs @@ -148,7 +148,7 @@ module GHC.PArr ( import Prelude -import GHC.ST ( ST(..), STRep, runST ) +import GHC.ST ( ST(..), runST ) import GHC.Exts ( Int#, Array#, Int(I#), MutableArray#, newArray#, unsafeFreezeArray#, indexArray#, writeArray#, (<#), (>=#) ) diff --git a/GHC/Unicode.hs b/GHC/Unicode.hs index 7c4ed9f..ceb3c91 100644 --- a/GHC/Unicode.hs +++ b/GHC/Unicode.hs @@ -31,7 +31,6 @@ module GHC.Unicode ( import GHC.Base import GHC.Real (fromIntegral) import GHC.Int -import GHC.Word import GHC.Num (fromInteger) #include "HsBaseConfig.h" diff --git a/Prelude.hs b/Prelude.hs index 8eb912b..813d252 100644 --- a/Prelude.hs +++ b/Prelude.hs @@ -146,21 +146,16 @@ module Prelude ( #ifndef __HUGS__ import Control.Monad import System.IO -import Text.Read -import Text.Show import Data.List import Data.Either import Data.Maybe -import Data.Bool import Data.Tuple -import Data.Eq -import Data.Ord #endif #ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IOBase -import GHC.Exception +import GHC.Exception ( throw ) import GHC.Read import GHC.Enum import GHC.Num @@ -170,7 +165,7 @@ import GHC.Show import GHC.Err ( error, undefined ) #endif -import qualified Control.OldException as Old +import qualified Control.OldException as Old hiding ( throw ) #ifdef __HUGS__ import Hugs.Prelude diff --git a/System/IO/Error.hs b/System/IO/Error.hs index 6d1f149..55b9ca4 100644 --- a/System/IO/Error.hs +++ b/System/IO/Error.hs @@ -98,7 +98,6 @@ import Data.Maybe #ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IOBase -import GHC.Exception import Text.Show #endif -- 1.7.10.4