diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs
index 20fe63c6d2d63298df651c2745fd27aa40d9f011..cc66632e98e364768aee378d732ea37c3755a89f 100644
--- a/ghc/compiler/main/CodeOutput.lhs
+++ b/ghc/compiler/main/CodeOutput.lhs
@@ -24,13 +24,12 @@ import Id		( Id )
 import Class		( Class )
 import CoreSyn		( CoreBind )
 import StgSyn		( StgBinding )
-import AbsCSyn		( AbstractC, absCNop )
+import AbsCSyn		( AbstractC )
 import PprAbsC		( dumpRealC, writeRealC )
 import UniqSupply	( UniqSupply )
-import Module		( Module, moduleString )
+import Module		( Module )
 import CmdLineOpts
-import Maybes		( maybeToBool )
-import ErrUtils		( doIfSet, dumpIfSet )
+import ErrUtils		( dumpIfSet )
 import Outputable
 import IO		( IOMode(..), hClose, openFile, Handle )
 \end{code}
diff --git a/ghc/compiler/main/Main.lhs b/ghc/compiler/main/Main.lhs
index e9827b4b50603dff3b81cc0d4a67db78044ce0e0..ab318408b7ab11c994f2120592823a3e7bb61561 100644
--- a/ghc/compiler/main/Main.lhs
+++ b/ghc/compiler/main/Main.lhs
@@ -10,13 +10,12 @@ module Main ( main ) where
 
 import IO		( hPutStr, stderr )
 import HsSyn
-import BasicTypes	( NewOrData(..) )
 
 import RdrHsSyn		( RdrNameHsModule )
-import FastString	( mkFastCharString, unpackFS )
+import FastString	( unpackFS )
 import StringBuffer	( hGetStringBuffer )
 import Parser		( parse )
-import Lex		( PState(..), P, ParseResult(..) )
+import Lex		( PState(..), ParseResult(..) )
 import SrcLoc		( mkSrcLoc )
 
 import Rename		( renameModule )
@@ -26,25 +25,19 @@ import TcModule		( TcResults(..), typecheckModule )
 import Desugar		( deSugar )
 import SimplCore	( core2core )
 import OccurAnal	( occurAnalyseBinds )
-import CoreLint		( endPass )
 import CoreUtils	( coreBindsSize )
 import CoreTidy		( tidyCorePgm )
 import CoreToStg	( topCoreBindsToStg )
-import StgSyn		( collectFinalStgBinders, pprStgBindings )
+import StgSyn		( collectFinalStgBinders )
 import SimplStg		( stg2stg )
 import CodeGen		( codeGen )
 import CodeOutput	( codeOutput )
 
 import Module		( ModuleName, moduleNameUserString )
-import AbsCSyn		( absCNop )
 import CmdLineOpts
 import ErrUtils		( ghcExit, doIfSet, dumpIfSet )
-import Maybes		( maybeToBool, MaybeErr(..) )
-import TyCon		( isDataTyCon )
-import Class		( classTyCon )
 import UniqSupply	( mkSplitUniqSupply )
 
-import FiniteMap	( emptyFM )
 import Outputable
 import Char		( isSpace )
 #if REPORT_TO_MOTHERLODE && __GLASGOW_HASKELL__ >= 303
diff --git a/ghc/compiler/nativeGen/AsmRegAlloc.lhs b/ghc/compiler/nativeGen/AsmRegAlloc.lhs
index 92f395a3a075f214af978d8a5d4e407d289b121b..790a955d93791ec5b618b978e50f4c494e55ec86 100644
--- a/ghc/compiler/nativeGen/AsmRegAlloc.lhs
+++ b/ghc/compiler/nativeGen/AsmRegAlloc.lhs
@@ -10,16 +10,13 @@ module AsmRegAlloc ( runRegAllocate ) where
 
 import MachCode		( InstrBlock )
 import MachMisc		( Instr(..) )
-import PprMach		( pprUserReg, pprInstr ) -- debugging
 import MachRegs
 import RegAllocInfo
 
 import FiniteMap	( FiniteMap, emptyFM, addListToFM, delListFromFM, 
 			  lookupFM, keysFM, eltsFM, mapFM, addToFM_C, addToFM,
 			  listToFM, fmToList, lookupWithDefaultFM )
-import Maybes		( maybeToBool )
 import Unique		( mkBuiltinUnique )
-import Util		( mapAccumB )
 import OrdList		( unitOL, appOL, fromOL, concatOL )
 import Outputable
 import Unique		( Unique, Uniquable(..), mkPseudoUnique3 )
diff --git a/ghc/compiler/nativeGen/MachCode.lhs b/ghc/compiler/nativeGen/MachCode.lhs
index 3fd6dd9dd6c8928e8cfdecd643f67a6556027201..41bec6771dfa29f548aeec9cbd9437a54d881027 100644
--- a/ghc/compiler/nativeGen/MachCode.lhs
+++ b/ghc/compiler/nativeGen/MachCode.lhs
@@ -18,7 +18,6 @@ import MachMisc		-- may differ per-platform
 import MachRegs
 import OrdList		( OrdList, nilOL, isNilOL, unitOL, appOL, toOL,
 			  snocOL, consOL, concatOL )
-import AbsCSyn		( MagicId )
 import AbsCUtils	( magicIdPrimRep )
 import CallConv		( CallConv )
 import CLabel		( isAsmTemp, CLabel, pprCLabel_asm, labelDynamic )
diff --git a/ghc/compiler/nativeGen/MachMisc.lhs b/ghc/compiler/nativeGen/MachMisc.lhs
index 0d39e9cd21df77b2febb80b45a8b7a877c26ba28..b06cac3504a72629640eee295000cf086db3d06b 100644
--- a/ghc/compiler/nativeGen/MachMisc.lhs
+++ b/ghc/compiler/nativeGen/MachMisc.lhs
@@ -50,12 +50,10 @@ import MachRegs		( stgReg, callerSaves, RegLoc(..),
 #                         endif
 			)
 import PrimRep		( PrimRep(..) )
-import SMRep		( SMRep(..) )
 import Stix		( StixTree(..), StixReg(..), CodeSegment )
 import Panic		( panic )
-import Char		( isDigit )
 import GlaExts		( word2Int#, int2Word#, shiftRL#, and#, (/=#) )
-import Outputable	( text, pprPanic, ppr )
+import Outputable	( pprPanic, ppr )
 import IOExts		( trace )
 \end{code}
 
diff --git a/ghc/compiler/nativeGen/PprMach.lhs b/ghc/compiler/nativeGen/PprMach.lhs
index 820a6390b52b6e3f8474a530241e097d4fb77964..dd15c6e555ac38fb25c7e8a177658aa0a973a0d7 100644
--- a/ghc/compiler/nativeGen/PprMach.lhs
+++ b/ghc/compiler/nativeGen/PprMach.lhs
@@ -18,8 +18,6 @@ import MachRegs		-- may differ per-platform
 import MachMisc
 
 import CLabel		( pprCLabel_asm, externallyVisibleCLabel, labelDynamic )
-import CStrings		( charToC )
-import Maybes		( maybeToBool )
 import Stix		( CodeSegment(..), StixTree(..) )
 import Char		( isPrint, isDigit )
 import Outputable
diff --git a/ghc/compiler/nativeGen/RegAllocInfo.lhs b/ghc/compiler/nativeGen/RegAllocInfo.lhs
index a401f852feb9b2d6d6bada5b9c6ee23ef5e69182..f55e49812198513a91680e7b871a56f46156603d 100644
--- a/ghc/compiler/nativeGen/RegAllocInfo.lhs
+++ b/ghc/compiler/nativeGen/RegAllocInfo.lhs
@@ -37,16 +37,11 @@ module RegAllocInfo (
 #include "HsVersions.h"
 
 import List		( partition, sort )
-import OrdList		( unitOL )
 import MachMisc
 import MachRegs
-import MachCode		( InstrBlock )
 
-import BitSet		( unitBS, mkBS, minusBS, unionBS, listBS, BitSet )
 import CLabel		( pprCLabel_asm, isAsmTemp, CLabel{-instance Ord-} )
 import FiniteMap	( addToFM, lookupFM, FiniteMap )
-import PrimRep		( PrimRep(..) )
-import UniqSet		-- quite a bit of it
 import Outputable
 import Constants	( rESERVED_C_STACK_BYTES )
 import Unique		( Unique, Uniquable(..) )
diff --git a/ghc/compiler/nativeGen/Stix.lhs b/ghc/compiler/nativeGen/Stix.lhs
index e90a6d6add69375f888310fbb1252f6106b5ee32..e222cdc6d583b4a64024fc61611ee6dccd742979 100644
--- a/ghc/compiler/nativeGen/Stix.lhs
+++ b/ghc/compiler/nativeGen/Stix.lhs
@@ -28,7 +28,6 @@ module Stix (
 import Ratio		( Rational )
 
 import AbsCSyn		( node, tagreg, MagicId(..) )
-import AbsCUtils	( magicIdPrimRep )
 import CallConv		( CallConv, pprCallConv )
 import CLabel		( mkAsmTempLabel, CLabel, pprCLabel, pprCLabel_asm )
 import PrimRep          ( PrimRep(..), showPrimRep )
@@ -37,7 +36,6 @@ import Unique           ( Unique )
 import SMRep		( fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize )
 import UniqSupply	( UniqSupply, splitUniqSupply, uniqFromSupply,
                           UniqSM, thenUs, returnUs, getUniqueUs )
-import CmdLineOpts	( opt_Static )
 import Outputable
 \end{code}
 
diff --git a/ghc/compiler/nativeGen/StixInfo.lhs b/ghc/compiler/nativeGen/StixInfo.lhs
index 1bfefc32d6fd6592f6837a1d9c424c7c1dabc305..16feabc46ebf0c428fb387fa5c02bbe711581d3f 100644
--- a/ghc/compiler/nativeGen/StixInfo.lhs
+++ b/ghc/compiler/nativeGen/StixInfo.lhs
@@ -20,7 +20,6 @@ import PrimRep		( PrimRep(..) )
 import SMRep		( SMRep(..), getSMRepClosureTypeInt )
 import Stix		-- all of it
 import UniqSupply	( returnUs, UniqSM )
-import Outputable	( int )
 import BitSet		( intBS )
 import Maybes		( maybeToBool )
 
diff --git a/ghc/compiler/nativeGen/StixMacro.lhs b/ghc/compiler/nativeGen/StixMacro.lhs
index eb49df231c8551a2a1a4c6af461663984e6cdf03..19c02d2e52536455a5e92cf7edb5dcda76a99f60 100644
--- a/ghc/compiler/nativeGen/StixMacro.lhs
+++ b/ghc/compiler/nativeGen/StixMacro.lhs
@@ -10,7 +10,6 @@ module StixMacro ( macroCode, checkCode ) where
 
 import {-# SOURCE #-} StixPrim ( amodeToStix )
 
-import MachMisc
 import MachRegs
 import AbsCSyn		( CStmtMacro(..), MagicId(..), CAddrMode, tagreg,
 			  CCheckMacro(..) )
@@ -20,7 +19,6 @@ import PrimOp		( PrimOp(..) )
 import PrimRep		( PrimRep(..) )
 import Stix
 import UniqSupply	( returnUs, thenUs, UniqSM )
-import Outputable
 import CLabel		( mkBlackHoleInfoTableLabel, mkIndStaticInfoLabel,
 			  mkIndInfoLabel, mkUpdInfoLabel, mkSeqInfoLabel,
 			  mkRtsGCEntryLabel, mkStgUpdatePAPLabel )
diff --git a/ghc/compiler/parser/ParseUtil.lhs b/ghc/compiler/parser/ParseUtil.lhs
index 430460aa24f7212eff5920db17ed8b9ee2238612..c491803e93078945335349d0e438dd9dddf66105 100644
--- a/ghc/compiler/parser/ParseUtil.lhs
+++ b/ghc/compiler/parser/ParseUtil.lhs
@@ -59,7 +59,6 @@ import CmdLineOpts 	( opt_NoImplicitPrelude )
 import StringBuffer 	( lexemeToString )
 import FastString	( unpackFS )
 import BasicTypes	( Boxity(..) )
-import ErrUtils
 import UniqFM		( UniqFM, listToUFM, lookupUFM )
 import Outputable
 
diff --git a/ghc/compiler/prelude/PrelInfo.lhs b/ghc/compiler/prelude/PrelInfo.lhs
index 12acaa9215dbdf51246c1e5778b5a15dc29d9840..94666c7101ed3719dd805d082b066e190c9c898e 100644
--- a/ghc/compiler/prelude/PrelInfo.lhs
+++ b/ghc/compiler/prelude/PrelInfo.lhs
@@ -41,13 +41,11 @@ import PrelNames	-- Prelude module names
 
 import PrimOp		( PrimOp(..), allThePrimOps, primOpRdrName )
 import DataCon		( DataCon, dataConId, dataConWrapId )
-import PrimRep		( PrimRep(..) )
 import TysPrim		-- TYPES
 import TysWiredIn
 
 -- others:
 import RdrName		( RdrName )
-import Var		( varUnique, Id )
 import Name		( Name, OccName, Provenance(..), 
 			  NameSpace, tcName, clsName, varName, dataName,
 			  mkKnownKeyGlobal,
@@ -61,7 +59,6 @@ import BasicTypes	( Boxity(..) )
 import Unique		-- *Key stuff
 import UniqFM		( UniqFM, listToUFM )
 import Util		( isIn )
-import Panic		( panic )
 \end{code}
 
 %************************************************************************
diff --git a/ghc/compiler/prelude/PrelRules.lhs b/ghc/compiler/prelude/PrelRules.lhs
index 4e502568d178626d219cec28c1c30e8438f6f1f9..801095e7d9e2cbdcaf8803345351daf5baa51a27 100644
--- a/ghc/compiler/prelude/PrelRules.lhs
+++ b/ghc/compiler/prelude/PrelRules.lhs
@@ -13,9 +13,9 @@ module PrelRules ( primOpRule, builtinRules ) where
 #include "HsVersions.h"
 
 import CoreSyn
-import Rules		( ProtoCoreRule(..) )
-import Id		( idUnfolding, mkWildId, isDataConId_maybe )
-import Literal		( Literal(..), isLitLitLit, mkMachInt, mkMachWord, literalType
+import Id		( mkWildId )
+import Literal		( Literal(..), isLitLitLit, mkMachInt, mkMachWord
+			, inIntRange, inWordRange, literalType
 			, word2IntLit, int2WordLit, char2IntLit, int2CharLit
 			, float2IntLit, int2FloatLit, double2IntLit, int2DoubleLit
 			, addr2IntLit, int2AddrLit, float2DoubleLit, double2FloatLit
@@ -24,32 +24,18 @@ import RdrName		( RdrName )
 import PrimOp		( PrimOp(..), primOpOcc )
 import TysWiredIn	( trueDataConId, falseDataConId )
 import TyCon		( tyConDataConsIfAvailable, isEnumerationTyCon, isNewTyCon )
-import DataCon		( DataCon, dataConTag, dataConRepArity, dataConTyCon, dataConId, fIRST_TAG )
-import CoreUnfold	( maybeUnfoldingTemplate )
+import DataCon		( dataConTag, dataConTyCon, dataConId, fIRST_TAG )
 import CoreUtils	( exprIsValue, cheapEqExpr, exprIsConApp_maybe )
 import Type		( splitTyConApp_maybe )
 import OccName		( occNameUserString)
 import PrelNames	( unpackCStringFoldr_RDR )
 import Unique		( unpackCStringFoldrIdKey, hasKey )
-import Maybes		( maybeToBool )
-import Char		( ord, chr )
 import Bits		( Bits(..) )
-import PrelAddr		( wordToInt )
 import Word		( Word64 )
 import Outputable
-
-#if __GLASGOW_HASKELL__ > 405
-import PrelAddr ( intToWord )
-#else
-import PrelAddr ( Word(..) )
-import PrelGHC  ( int2Word# )
-intToWord :: Int -> Word
-intToWord (I# i#) = W# (int2Word# i#)
-#endif
 \end{code}
 
 
-
 \begin{code}
 primOpRule :: PrimOp -> CoreRule
 primOpRule op 
diff --git a/ghc/compiler/prelude/TysWiredIn.lhs b/ghc/compiler/prelude/TysWiredIn.lhs
index 7a809e3eb1d4482aa9a78c12e36153a1ba63d46b..55bb4453c3d0807dea16a271f825618a6046d02c 100644
--- a/ghc/compiler/prelude/TysWiredIn.lhs
+++ b/ghc/compiler/prelude/TysWiredIn.lhs
@@ -87,17 +87,14 @@ import Var		( TyVar, tyVarKind )
 import TyCon		( TyCon, AlgTyConFlavour(..), ArgVrcs, tyConDataCons,
 			  mkAlgTyCon, mkSynTyCon, mkTupleTyCon, isUnLiftedTyCon
 			)
-import BasicTypes	( Arity, NewOrData(..), RecFlag(..), Boxity(..), isBoxed )
+import BasicTypes	( Arity, RecFlag(..), Boxity(..), isBoxed )
 import Type		( Type, mkTyConTy, mkTyConApp, mkSigmaTy, mkTyVarTys, 
 			  mkArrowKinds, boxedTypeKind, unboxedTypeKind,
 			  mkFunTy, mkFunTys,
 			  splitTyConApp_maybe, repType,
 			  TauType, ClassContext )
-import PrimRep		( PrimRep(..) )
 import Unique
 import CmdLineOpts      ( opt_GlasgowExts )
-import Util		( assoc )
-import Panic		( panic )
 import Array
 
 alpha_tyvar	  = [alphaTyVar]
diff --git a/ghc/compiler/profiling/SCCfinal.lhs b/ghc/compiler/profiling/SCCfinal.lhs
index 5fc41a1fefd834e68fd4449e9706b4e3496a314f..1c22d06e2b1b69159e6ceb2e0e0c1914a6827d64 100644
--- a/ghc/compiler/profiling/SCCfinal.lhs
+++ b/ghc/compiler/profiling/SCCfinal.lhs
@@ -31,15 +31,11 @@ import StgSyn
 
 import CmdLineOpts	( opt_AutoSccsOnIndividualCafs )
 import CostCentre	-- lots of things
-import Id		( Id, mkSysLocal, idType, idName )
+import Id		( Id )
 import Module		( Module )
 import UniqSupply	( uniqFromSupply, splitUniqSupply, UniqSupply )
 import Unique           ( Unique )
-import Type		( splitForAllTys, splitTyConApp_maybe )
-import TyCon		( isFunTyCon )
 import VarSet
-import UniqSet
-import Name		( isLocallyDefined )
 import Util		( removeDups )
 import Outputable	
 
diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs
index 1a9cc0bcc06d8ad3e8be745147b65ab72bd5d420..e6229017d36477eb556124f28bd95913f65e0a47 100644
--- a/ghc/compiler/rename/Rename.lhs
+++ b/ghc/compiler/rename/Rename.lhs
@@ -23,13 +23,13 @@ import RnMonad
 import RnNames		( getGlobalNames )
 import RnSource		( rnSourceDecls, rnDecl )
 import RnIfaces		( getImportedInstDecls, importDecl, mkImportExportInfo, getInterfaceExports,
-			  getImportedRules, loadHomeInterface, getSlurped, removeContext,
+			  getImportedRules, getSlurped, removeContext,
 			  loadBuiltinRules, getDeferredDecls, ImportDeclResult(..)
 			)
 import RnEnv		( availName, availsToNameSet, 
 			  emptyAvailEnv, unitAvailEnv, availEnvElts, plusAvailEnv, 
 			  warnUnusedImports, warnUnusedLocalBinds, warnUnusedModules,
-			  lookupImplicitOccsRn, pprAvail, unknownNameErr,
+			  lookupImplicitOccsRn, unknownNameErr,
 			  FreeVars, plusFVs, plusFV, unitFV, emptyFVs, isEmptyFVs, addOneFV
 			)
 import Module           ( Module, ModuleName, WhereFrom(..),
@@ -38,7 +38,7 @@ import Module           ( Module, ModuleName, WhereFrom(..),
 import Name		( Name, isLocallyDefined, NamedThing(..), getSrcLoc,
 			  nameOccName, nameUnique, nameModule, maybeUserImportedFrom,
 			  isUserImportedExplicitlyName, isUserImportedName,
-			  maybeWiredInTyConName, maybeWiredInIdName, isWiredInName,
+			  maybeWiredInTyConName, maybeWiredInIdName,
 			  isUserExportedName, toRdrName
 			)
 import OccName		( occNameFlavour, isValOcc )
diff --git a/ghc/compiler/rename/RnBinds.lhs b/ghc/compiler/rename/RnBinds.lhs
index 17284cedc3a77fc96e144929d0e0a578e7a4672a..33d99ff7336a1a59f5a05bfbe4e062ec4dfa25c7 100644
--- a/ghc/compiler/rename/RnBinds.lhs
+++ b/ghc/compiler/rename/RnBinds.lhs
@@ -38,12 +38,8 @@ import Name		( OccName, Name, nameOccName, mkUnboundName, isUnboundName )
 import NameSet
 import RdrName		( RdrName, rdrNameOcc  )
 import BasicTypes	( RecFlag(..), TopLevelFlag(..) )
-import Util		( thenCmp, removeDups )
 import List		( partition )
-import ListSetOps	( minusList )
 import Bag		( bagToList )
-import FiniteMap	( lookupFM, listToFM )
-import Maybe		( isJust )
 import Outputable
 \end{code}
 
diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs
index 6bdb45bcb1df1f37e137ce5faec2d8a7c26260d4..14a833959abb42f950d93858b8b974507e0e0b54 100644
--- a/ghc/compiler/rename/RnEnv.lhs
+++ b/ghc/compiler/rename/RnEnv.lhs
@@ -35,9 +35,7 @@ import OccName		( OccName,
 import TysWiredIn	( listTyCon )
 import Type		( funTyCon )
 import Module		( ModuleName, mkThisModule, moduleName, mkVanillaModule, pprModuleName )
-import TyCon		( TyCon )
 import FiniteMap
-import Unique		( Unique, Uniquable(..) )
 import UniqSupply
 import SrcLoc		( SrcLoc, noSrcLoc )
 import Outputable
diff --git a/ghc/compiler/rename/RnIfaces.lhs b/ghc/compiler/rename/RnIfaces.lhs
index f1f51bc4304d8ba09f95f42c79d5a0c7b5c7e9b2..3f775a47961ee88ed8e494f2ac175f601be870ee 100644
--- a/ghc/compiler/rename/RnIfaces.lhs
+++ b/ghc/compiler/rename/RnIfaces.lhs
@@ -30,19 +30,13 @@ import HsSyn		( HsDecl(..), TyClDecl(..), InstDecl(..), IfaceSig(..),
 			)
 import HsImpExp		( ieNames )
 import CoreSyn		( CoreRule )
-import BasicTypes	( Version, NewOrData(..), defaultFixity )
-import RdrHsSyn		( RdrNameHsDecl, RdrNameInstDecl, RdrNameTyClDecl, RdrNameRuleDecl,
-			  RdrNameFixitySig, RdrNameDeprecation, RdrNameIE,
+import BasicTypes	( Version, NewOrData(..) )
+import RdrHsSyn		( RdrNameHsDecl, RdrNameInstDecl, RdrNameRuleDecl,
+			  RdrNameDeprecation, RdrNameIE,
 			  extractHsTyRdrNames 
 			)
-import RnEnv		( mkImportedGlobalName, newTopBinder, mkImportedGlobalFromRdrName,
-			  lookupOccRn, lookupImplicitOccRn,
-			  pprAvail, rdrAvailInfo,
-			  availName, availNames, addAvailToNameSet, addSysAvails,
-			  FreeVars, emptyFVs
-			)
+import RnEnv
 import RnMonad
-import RnHsSyn          ( RenamedHsDecl, RenamedDeprecation )
 import ParseIface	( parseIface, IfaceStuff(..) )
 
 import Name		( Name {-instance NamedThing-}, nameOccName,
@@ -56,22 +50,19 @@ import Module		( Module, moduleString, pprModule,
 			)
 import RdrName		( RdrName, rdrNameOcc )
 import NameSet
-import Var		( Id )
 import SrcLoc		( mkSrcLoc, SrcLoc )
-import PrelInfo		( pREL_GHC, cCallishTyKeys )
+import PrelInfo		( cCallishTyKeys )
 import Maybes		( MaybeErr(..), maybeToBool, orElse )
-import ListSetOps	( unionLists )
-import Unique		( Unique, Uniquable(..) )
-import StringBuffer     ( StringBuffer, hGetStringBuffer )
+import Unique		( Uniquable(..) )
+import StringBuffer     ( hGetStringBuffer )
 import FastString	( mkFastString )
 import ErrUtils         ( Message )
-import Util		( sortLt, lengthExceeds )
+import Util		( sortLt )
 import Lex
 import FiniteMap
 import Outputable
 import Bag
 
-import IO	( isDoesNotExistError )
 import List	( nub )
 \end{code}
 
diff --git a/ghc/compiler/rename/RnMonad.lhs b/ghc/compiler/rename/RnMonad.lhs
index 1756133f3ef072d00a389026dfb0d86da48fb68b..1159bfe6511bffa8b7cbbc796f0921fb93648e4d 100644
--- a/ghc/compiler/rename/RnMonad.lhs
+++ b/ghc/compiler/rename/RnMonad.lhs
@@ -57,17 +57,13 @@ import Module		( Module, ModuleName, ModuleHiMap, SearchPath, WhereFrom,
 import NameSet		
 import CmdLineOpts	( opt_D_dump_rn_trace, opt_HiMap )
 import PrelInfo		( builtinNames )
-import TysWiredIn	( boolTyCon )
 import SrcLoc		( SrcLoc, mkGeneratedSrcLoc )
 import Unique		( Unique, getUnique, unboundKey )
 import FiniteMap	( FiniteMap, emptyFM, bagToFM, lookupFM, addToFM, addListToFM, 
 			  addListToFM_C, addToFM_C, eltsFM, fmToList
 			)
 import Bag		( Bag, mapBag, emptyBag, isEmptyBag, snocBag )
-import Maybes		( mapMaybe )
-import UniqSet
 import UniqSupply
-import Util
 import Outputable
 
 infixr 9 `thenRn`, `thenRn_`
diff --git a/ghc/compiler/rename/RnNames.lhs b/ghc/compiler/rename/RnNames.lhs
index 979bc00861653103e02fbc8cbd5497d584a24a6f..f07651e24f60c5c961cff2c99041bde561dd456d 100644
--- a/ghc/compiler/rename/RnNames.lhs
+++ b/ghc/compiler/rename/RnNames.lhs
@@ -46,7 +46,6 @@ import NameSet	( elemNameSet, emptyNameSet )
 import Outputable
 import Maybes	( maybeToBool, catMaybes, mapMaybe )
 import UniqFM   ( emptyUFM, listToUFM, plusUFM_C )
-import Unique	( getUnique )
 import Util	( removeDups, equivClassesByUniq, sortLt )
 import List	( partition )
 \end{code}
diff --git a/ghc/compiler/rename/RnSource.lhs b/ghc/compiler/rename/RnSource.lhs
index ddacf62ee28d3d5ea87c1b29a39c2851e63ff510..b2c4aa26f888470539950c4e3fdebe3ac0876408 100644
--- a/ghc/compiler/rename/RnSource.lhs
+++ b/ghc/compiler/rename/RnSource.lhs
@@ -43,7 +43,6 @@ import Name		( Name, OccName,
 			)
 import NameSet
 import OccName		( mkDefaultMethodOcc )
-import BasicTypes	( TopLevelFlag(..) )
 import FiniteMap	( elemFM )
 import PrelInfo		( derivableClassKeys, cCallishClassKeys,
 			  deRefStablePtr_RDR, makeStablePtr_RDR, 
@@ -55,7 +54,6 @@ import Outputable
 import SrcLoc		( SrcLoc )
 import CmdLineOpts	( opt_GlasgowExts, opt_WarnUnusedMatches )	-- Warn of unused for-all'd tyvars
 import Unique		( Uniquable(..) )
-import UniqFM		( lookupUFM )
 import ErrUtils		( Message )
 import CStrings		( isCLabelString )
 import Maybes		( maybeToBool, catMaybes )
diff --git a/ghc/compiler/simplCore/FloatOut.lhs b/ghc/compiler/simplCore/FloatOut.lhs
index c929be33705eedd277fb2fe0e045e72e23243a0b..cf95cbe505a6b41232a64ace4c8e6faa8725994b 100644
--- a/ghc/compiler/simplCore/FloatOut.lhs
+++ b/ghc/compiler/simplCore/FloatOut.lhs
@@ -19,11 +19,9 @@ import CostCentre	( dupifyCC, CostCentre )
 import Id		( Id, idType )
 import VarEnv
 import CoreLint		( beginPass, endPass )
-import PprCore
 import SetLevels	( setLevels,
 		 	  Level(..), tOP_LEVEL, ltMajLvl, ltLvl, isTopLvl
 			)
-import BasicTypes	( Unused )
 import Type		( isUnLiftedType )
 import Var		( TyVar )
 import UniqSupply       ( UniqSupply )
diff --git a/ghc/compiler/simplCore/LiberateCase.lhs b/ghc/compiler/simplCore/LiberateCase.lhs
index f70b692ac7060c0bc32b05c1d8c2b7d2bfc60d26..bd9bac25e72f9f036be87eabc7bb0dc1ff7a0630 100644
--- a/ghc/compiler/simplCore/LiberateCase.lhs
+++ b/ghc/compiler/simplCore/LiberateCase.lhs
@@ -15,8 +15,6 @@ import CoreUnfold	( couldBeSmallEnoughToInline )
 import Var		( Id )
 import VarEnv
 import Maybes
-import Outputable
-import Util
 \end{code}
 
 This module walks over @Core@, and looks for @case@ on free variables.
diff --git a/ghc/compiler/simplCore/OccurAnal.lhs b/ghc/compiler/simplCore/OccurAnal.lhs
index ef5ce99979af2e4ee544714698b2a997efeb54d9..4681aa3edae27969f273f4d6ee5741e19aeab7b1 100644
--- a/ghc/compiler/simplCore/OccurAnal.lhs
+++ b/ghc/compiler/simplCore/OccurAnal.lhs
@@ -18,11 +18,9 @@ module OccurAnal (
 #include "HsVersions.h"
 
 import BinderInfo
-import CmdLineOpts	( SimplifierSwitch(..) )
 import CoreSyn
 import CoreFVs		( idRuleVars )
 import CoreUtils	( exprIsTrivial )
-import Literal		( Literal(..) )
 import Id		( isSpecPragmaId, isDataConId, isOneShotLambda, setOneShotLambda, 
 			  idOccInfo, setIdOccInfo,
 			  isExportedId, modifyIdInfo, idInfo,
diff --git a/ghc/compiler/simplCore/SetLevels.lhs b/ghc/compiler/simplCore/SetLevels.lhs
index e5f020a6bf8d3f911de5b8cc8ceac3e4a615372e..91dbe75aee45903d82049d2e2257387eb4c40a23 100644
--- a/ghc/compiler/simplCore/SetLevels.lhs
+++ b/ghc/compiler/simplCore/SetLevels.lhs
@@ -49,7 +49,7 @@ import Id		( Id, idType, idFreeTyVars, mkSysLocal, isOneShotLambda, modifyIdInfo
 			  idSpecialisation, idWorkerInfo, setIdInfo
 			)
 import IdInfo		( workerExists, vanillaIdInfo, demandInfo, setDemandInfo )
-import Var		( Var, TyVar, setVarUnique )
+import Var		( Var, setVarUnique )
 import VarSet
 import VarEnv
 import Name		( getOccName )
diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs
index 11b14f10a81b95aee50f996dba4831b728d1d9db..fda56fe4eae7056bccc6d80a20f8ec40de480e5c 100644
--- a/ghc/compiler/simplCore/SimplCore.lhs
+++ b/ghc/compiler/simplCore/SimplCore.lhs
@@ -9,11 +9,11 @@ module SimplCore ( core2core ) where
 #include "HsVersions.h"
 
 import CmdLineOpts	( CoreToDo(..), SimplifierSwitch(..), 
-			  SwitchResult(..), switchIsOn, intSwitchSet,
+			  SwitchResult(..), intSwitchSet,
 			  opt_D_dump_occur_anal, opt_D_dump_rules,
 			  opt_D_dump_simpl_iterations,
 			  opt_D_dump_simpl_stats,
-			  opt_D_dump_simpl, opt_D_dump_rules,
+			  opt_D_dump_rules,
 			  opt_D_verbose_core2core,
 			  opt_D_dump_occur_anal,
                           opt_UsageSPOn,
@@ -22,34 +22,19 @@ import CoreLint		( beginPass, endPass )
 import CoreSyn
 import CSE		( cseProgram )
 import Rules		( RuleBase, ProtoCoreRule(..), pprProtoCoreRule, prepareLocalRuleBase,
-                          prepareOrphanRuleBase, unionRuleBase, localRule, orphanRule )
+                          prepareOrphanRuleBase, unionRuleBase, localRule )
 import CoreUnfold
 import PprCore		( pprCoreBindings )
 import OccurAnal	( occurAnalyseBinds )
 import CoreUtils	( exprIsTrivial, etaReduceExpr, coreBindsSize )
 import Simplify		( simplTopBinds, simplExpr )
-import SimplUtils	( findDefault, simplBinders )
+import SimplUtils	( simplBinders )
 import SimplMonad
-import Literal		( Literal(..), literalType, mkMachInt )
 import ErrUtils		( dumpIfSet )
 import FloatIn		( floatInwards )
 import FloatOut		( floatOutwards )
-import Id		( Id, mkSysLocal, mkVanillaId, isBottomingId, isDataConWrapId,
-			  idType, setIdType, idName, idInfo, setIdNoDiscard
-			)
-import VarEnv
+import Id		( isDataConWrapId )
 import VarSet
-import Module		( Module )
-import Name		( mkLocalName, tidyOccName, tidyTopName, 
-			  NamedThing(..), OccName
-			)
-import TyCon		( TyCon, isDataTyCon )
-import Type		( Type, 
-			  isUnLiftedType,
-			  tidyType, tidyTypes, tidyTopType, tidyTyVar, tidyTyVars,
-			  Type
-			)
-import TysWiredIn	( smallIntegerDataCon, isIntegerTy )
 import LiberateCase	( liberateCase )
 import SAT		( doStaticArgs )
 import Specialise	( specProgram)
@@ -58,16 +43,10 @@ import StrictAnal	( saBinds )
 import WorkWrap	        ( wwTopBinds )
 import CprAnalyse       ( cprAnalyse )
 
-import Unique		( Unique, Uniquable(..) )
-import UniqSupply	( UniqSupply, mkSplitUniqSupply, splitUniqSupply, uniqFromSupply )
-import Util		( mapAccumL )
-import SrcLoc		( noSrcLoc )
-import Bag
-import Maybes
+import UniqSupply	( UniqSupply, mkSplitUniqSupply, splitUniqSupply )
 import IO		( hPutStr, stderr )
 import Outputable
 
-import Ratio 		( numerator, denominator )
 import List             ( partition )
 \end{code}
 
diff --git a/ghc/compiler/simplCore/SimplMonad.lhs b/ghc/compiler/simplCore/SimplMonad.lhs
index 97dee5c0cd463671a0d7565545422a948a55c271..a5d5a9806ae8bd5f31a857b05a7df8a6a8691409 100644
--- a/ghc/compiler/simplCore/SimplMonad.lhs
+++ b/ghc/compiler/simplCore/SimplMonad.lhs
@@ -46,24 +46,19 @@ module SimplMonad (
 #include "HsVersions.h"
 
 import Id		( Id, mkSysLocal, idUnfolding, isDataConWrapId )
-import IdInfo		( InlinePragInfo(..) )
-import Demand		( Demand )
 import CoreSyn
-import CoreUnfold	( isCompulsoryUnfolding, isEvaldUnfolding )
+import CoreUnfold	( isCompulsoryUnfolding )
 import PprCore		()	-- Instances
-import Rules		( RuleBase )
 import CostCentre	( CostCentreStack, subsumedCCS )
 import Name		( isLocallyDefined )
 import OccName		( UserFS )
-import Var		( TyVar )
 import VarEnv
 import VarSet
 import qualified Subst
-import Subst		( Subst, emptySubst, mkSubst, 
-			  substTy, substEnv, 
+import Subst		( Subst, mkSubst, substEnv, 
 			  InScopeSet, substInScope, isInScope
 			)
-import Type             ( Type, TyVarSubst, applyTy )
+import Type             ( Type )
 import UniqSupply	( uniqsFromSupply, uniqFromSupply, splitUniqSupply,
 			  UniqSupply
 			)
diff --git a/ghc/compiler/simplCore/SimplUtils.lhs b/ghc/compiler/simplCore/SimplUtils.lhs
index 34ee7d61151f4b5431acab7390848242dfc34401..d346292c332ca9ca4bf968ee58b4b2ef59cd93d8 100644
--- a/ghc/compiler/simplCore/SimplUtils.lhs
+++ b/ghc/compiler/simplCore/SimplUtils.lhs
@@ -18,12 +18,9 @@ module SimplUtils (
 
 #include "HsVersions.h"
 
-import BinderInfo
 import CmdLineOpts	( opt_SimplDoLambdaEtaExpansion, opt_SimplCaseMerge )
 import CoreSyn
-import PprCore		( {- instance Outputable Expr -} )
 import CoreUnfold	( isValueUnfolding )
-import CoreFVs		( exprFreeVars )
 import CoreUtils	( exprIsTrivial, cheapEqExpr, exprType, exprIsCheap, exprEtaExpandArity, bindNonRec )
 import Subst		( InScopeSet, mkSubst, substBndrs, substBndr, substIds, lookupIdSubst )
 import Id		( Id, idType, isId, idName, 
@@ -38,14 +35,9 @@ import Type		( Type, tyVarsOfType, tyVarsOfTypes, mkForAllTys, seqType, repType,
 			  splitTyConApp_maybe, mkTyVarTys, applyTys, splitFunTys, mkFunTys
 			)
 import TyCon		( tyConDataConsIfAvailable )
-import PprType		( {- instance Outputable Type -} )
 import DataCon		( dataConRepArity )
-import TysPrim		( statePrimTyCon )
-import Var		( setVarUnique )
 import VarSet
 import VarEnv		( SubstEnv, SubstResult(..) )
-import UniqSupply	( splitUniqSupply, uniqFromSupply )
-import Util		( zipWithEqual, mapAccumL )
 import Outputable
 \end{code}
 
diff --git a/ghc/compiler/simplCore/Simplify.lhs b/ghc/compiler/simplCore/Simplify.lhs
index 4b7f32d7f9bb6d7fb2973f23f071c99cd6ae0d03..ae04f14c6532654e4c0138d677845ce3a76eca0c 100644
--- a/ghc/compiler/simplCore/Simplify.lhs
+++ b/ghc/compiler/simplCore/Simplify.lhs
@@ -8,9 +8,8 @@ module Simplify ( simplTopBinds, simplExpr ) where
 
 #include "HsVersions.h"
 
-import CmdLineOpts	( intSwitchSet, switchIsOn,
-			  opt_SccProfilingOn, opt_PprStyle_Debug, opt_SimplDoEtaReduction,
-			  opt_SimplNoPreInlining, opt_DictsStrict, opt_SimplPedanticBottoms,
+import CmdLineOpts	( switchIsOn, opt_SimplDoEtaReduction,
+			  opt_SimplNoPreInlining, opt_DictsStrict,
 			  SimplifierSwitch(..)
 			)
 import SimplMonad
@@ -19,60 +18,50 @@ import SimplUtils	( mkCase, transformRhs, findAlt,
 			  SimplCont(..), DupFlag(..), contResultType, analyseCont, 
 			  discardInline, countArgs, countValArgs, discardCont, contIsDupable
 			)
-import Var		( TyVar, mkSysTyVar, tyVarKind, maybeModifyIdInfo )
+import Var		( mkSysTyVar, tyVarKind )
 import VarEnv
-import VarSet
-import Id		( Id, idType, idInfo, idUnique, isDataConId, isDataConId_maybe,
+import Id		( Id, idType, idInfo, isDataConId,
 			  idUnfolding, setIdUnfolding, isExportedId, isDeadBinder,
-			  idSpecialisation, setIdSpecialisation,
-			  idDemandInfo, 
-			  setIdInfo,
+			  idDemandInfo, setIdInfo,
 			  idOccInfo, setIdOccInfo,
-			  zapLamIdInfo, zapFragileIdInfo,
-			  idStrictness, isBottomingId,
-			  setInlinePragma, 
-			  setOneShotLambda, maybeModifyIdInfo
+			  zapLamIdInfo, idStrictness, setOneShotLambda, 
 			)
-import IdInfo		( InlinePragInfo(..), OccInfo(..), StrictnessInfo(..), 
-		 	  ArityInfo(..), atLeastArity, arityLowerBound, unknownArity,
-			  specInfo, inlinePragInfo, setArityInfo, setInlinePragInfo, setUnfoldingInfo,
-			  CprInfo(..), cprInfo, occInfo
+import IdInfo		( OccInfo(..), StrictnessInfo(..), ArityInfo(..),
+			  setArityInfo, setUnfoldingInfo,
+			  occInfo
 			)
 import Demand		( Demand, isStrict, wwLazy )
-import DataCon		( DataCon, dataConNumInstArgs, dataConRepStrictness, dataConRepArity,
+import DataCon		( dataConNumInstArgs, dataConRepStrictness,
 			  dataConSig, dataConArgTys
 			)
 import CoreSyn
-import CoreFVs		( exprFreeVars, mustHaveLocalBinding )
-import CoreUnfold	( Unfolding, mkOtherCon, mkUnfolding, otherCons, maybeUnfoldingTemplate,
-			  callSiteInline, hasSomeUnfolding, noUnfolding
+import CoreFVs		( mustHaveLocalBinding )
+import CoreUnfold	( mkOtherCon, mkUnfolding, otherCons,
+			  callSiteInline
 			)
-import CoreUtils	( cheapEqExpr, exprIsDupable, exprIsCheap, exprIsTrivial, exprIsConApp_maybe,
+import CoreUtils	( cheapEqExpr, exprIsDupable, exprIsTrivial, exprIsConApp_maybe,
 			  exprType, coreAltsType, exprArity, exprIsValue, idAppIsCheap,
 			  exprOkForSpeculation, etaReduceExpr,
 			  mkCoerce, mkSCC, mkInlineMe, mkAltExpr
 			)
 import Rules		( lookupRule )
-import CostCentre	( isSubsumedCCS, currentCCS, isEmptyCC )
-import Type		( Type, mkTyVarTy, mkTyVarTys, isUnLiftedType, seqType,
-			  mkFunTy, splitFunTy, splitFunTys, splitFunTy_maybe,
-			  splitTyConApp_maybe, 
-			  funResultTy, isDictTy, isDataType, applyTy, applyTys, mkFunTys
+import CostCentre	( currentCCS )
+import Type		( mkTyVarTys, isUnLiftedType, seqType,
+			  mkFunTy, splitFunTy, splitTyConApp_maybe, 
+			  funResultTy, isDictTy, isDataType, applyTy 
 			)
-import Subst		( Subst, mkSubst, emptySubst, substTy, substExpr,
-			  substEnv, isInScope, lookupIdSubst, substIdInfo
+import Subst		( mkSubst, substTy, substExpr,
+			  isInScope, lookupIdSubst, substIdInfo
 			)
 import TyCon		( isDataTyCon, tyConDataConsIfAvailable, 
-			  tyConClass_maybe, tyConArity, isDataTyCon
+			  isDataTyCon
 			)
 import TysPrim		( realWorldStatePrimTy )
 import PrelInfo		( realWorldPrimId )
-import BasicTypes	( TopLevelFlag(..), isTopLevel, isLoopBreaker )
+import BasicTypes	( isLoopBreaker )
 import Maybes		( maybeToBool )
 import Util		( zipWithEqual, lengthExceeds )
-import PprCore
 import Outputable
-import Unique		( foldrIdKey )	-- Temp
 \end{code}
 
 
diff --git a/ghc/compiler/simplStg/SimplStg.lhs b/ghc/compiler/simplStg/SimplStg.lhs
index 3f04f51b4e19b20d25c44c727b97f687dc7a5598..466f7fafee2063490c5c466bc693066bb32e3431 100644
--- a/ghc/compiler/simplStg/SimplStg.lhs
+++ b/ghc/compiler/simplStg/SimplStg.lhs
@@ -24,7 +24,6 @@ import CmdLineOpts	( opt_StgDoLetNoEscapes, opt_D_verbose_stg2stg,
 			)
 import Id		( Id )
 import Module		( Module, moduleString )
-import VarEnv
 import ErrUtils		( doIfSet, dumpIfSet )
 import UniqSupply	( splitUniqSupply, UniqSupply )
 import IO		( hPutStr, stdout )
diff --git a/ghc/compiler/specialise/Rules.lhs b/ghc/compiler/specialise/Rules.lhs
index 7a70d519c5a4baa87a965b9c4843e1b3b85aa783..b5c7002f9552200e15a1475e77b51bf151db967e 100644
--- a/ghc/compiler/specialise/Rules.lhs
+++ b/ghc/compiler/specialise/Rules.lhs
@@ -15,32 +15,28 @@ module Rules (
 
 import CoreSyn		-- All of it
 import OccurAnal	( occurAnalyseRule )
-import BinderInfo	( markMany )
 import CoreFVs		( exprFreeVars, idRuleVars, ruleRhsFreeVars, ruleSomeLhsFreeVars )
 import CoreUnfold	( isCheapUnfolding, unfoldingTemplate )
 import CoreUtils	( eqExpr )
 import PprCore		( pprCoreRule )
-import Subst		( Subst, InScopeSet, substBndr, lookupSubst, extendSubst,
-			  mkSubst, substEnv, setSubstEnv, emptySubst, isInScope,
-			  unBindSubst, bindSubstList, unBindSubstList, substInScope
+import Subst		( Subst, InScopeSet, lookupSubst, extendSubst,
+			  substEnv, setSubstEnv, emptySubst, isInScope,
+			  bindSubstList, unBindSubstList, substInScope
 			)
 import Id		( Id, idUnfolding, zapLamIdInfo, 
 			  idSpecialisation, setIdSpecialisation,
-			  setIdNoDiscard, maybeModifyIdInfo, modifyIdInfo
+			  setIdNoDiscard
 			) 
-import Name		( Name, isLocallyDefined )
+import Name		( isLocallyDefined )
 import Var		( isTyVar, isId )
 import VarSet
 import VarEnv
-import Type		( mkTyVarTy, getTyVar_maybe )
+import Type		( mkTyVarTy )
 import qualified Unify	( match )
-import CmdLineOpts	( opt_D_dump_simpl, opt_D_verbose_core2core )
 
 import UniqFM
-import ErrUtils		( dumpIfSet )
 import Outputable
 import Maybes		( maybeToBool )
-import List		( partition )
 import Util		( sortLt )
 \end{code}
 
diff --git a/ghc/compiler/specialise/Specialise.lhs b/ghc/compiler/specialise/Specialise.lhs
index 312609aa6c11c0ea45607648fb3e6a5ccd57b8df..d73e2c3f412c8dc657135a6b5b6b2c8d169d665d 100644
--- a/ghc/compiler/specialise/Specialise.lhs
+++ b/ghc/compiler/specialise/Specialise.lhs
@@ -21,7 +21,6 @@ import Type		( Type, mkTyVarTy, splitSigmaTy, splitFunTysN,
 			  tyVarsOfType, tyVarsOfTypes, tyVarsOfTheta, applyTys,
 			  mkForAllTys, boxedTypeKind
 			)
-import PprType		( {- instance Outputable Type -} )
 import Subst		( Subst, mkSubst, substTy, mkSubst, substBndrs, extendSubstList,
 			  substId, substAndCloneId, substAndCloneIds, lookupIdSubst, substInScope
 			) 
diff --git a/ghc/compiler/stgSyn/CoreToStg.lhs b/ghc/compiler/stgSyn/CoreToStg.lhs
index 44cff7e9450f5eb3aa79e87b4787fd295228c2f2..05ceb4d0929ca047a3e7f74da3b1f5f67e79dc29 100644
--- a/ghc/compiler/stgSyn/CoreToStg.lhs
+++ b/ghc/compiler/stgSyn/CoreToStg.lhs
@@ -17,32 +17,26 @@ module CoreToStg ( topCoreBindsToStg ) where
 import CoreSyn		-- input
 import StgSyn		-- output
 
-import PprCore		( {- instance Outputable Bind/Expr -} )
 import CoreUtils	( exprType )
 import SimplUtils	( findDefault )
 import CostCentre	( noCCS )
-import Id		( Id, mkSysLocal, idType, idStrictness, idUnique, isExportedId, mkVanillaId,
-			  externallyVisibleId, setIdUnique, idName, 
-			  idDemandInfo, idArity, setIdType, idFlavour
+import Id		( Id, mkSysLocal, idType, idStrictness, isExportedId, 
+			  mkVanillaId, idName, idDemandInfo, idArity, setIdType,
+			  idFlavour, idUnique
 			)
-import Var		( Var, varType, modifyIdInfo )
-import IdInfo		( setDemandInfo, StrictnessInfo(..), IdFlavour(..) )
-import UsageSPUtils     ( primOpUsgTys )
-import DataCon		( DataCon, dataConName, dataConWrapId )
-import Demand		( Demand, isStrict, wwStrict, wwLazy )
-import Name	        ( Name, nameModule, isLocallyDefinedName, setNameUnique )
-import Literal	        ( Literal(..) )
+import IdInfo		( StrictnessInfo(..), IdFlavour(..) )
+import DataCon		( dataConWrapId )
+import Demand		( Demand, isStrict, wwLazy )
+import Name	        ( setNameUnique )
 import VarEnv
-import PrimOp		( PrimOp(..), setCCallUnique, primOpUsg )
+import PrimOp		( PrimOp(..), setCCallUnique )
 import Type		( isUnLiftedType, isUnboxedTupleType, Type, splitFunTy_maybe,
-                          UsageAnn(..), tyUsg, applyTy, mkUsgTy, repType, seqType,
+                          UsageAnn(..), tyUsg, applyTy, repType, seqType,
 			  splitRepFunTys, mkFunTys
 			)
-import TysPrim		( intPrimTy )
 import UniqSupply	-- all of it, really
-import Util		( lengthExceeds )
-import BasicTypes	( TopLevelFlag(..), isNotTopLevel, Arity )
-import CmdLineOpts	( opt_D_verbose_stg2stg, opt_UsageSPOn )
+import BasicTypes	( TopLevelFlag(..), isNotTopLevel )
+import CmdLineOpts	( opt_D_verbose_stg2stg )
 import UniqSet		( emptyUniqSet )
 import Maybes
 import Outputable
diff --git a/ghc/compiler/stgSyn/StgLint.lhs b/ghc/compiler/stgSyn/StgLint.lhs
index 24bad62f184a218b55b2eff542147cebbbaf3412..6a72b9e9d821d8282ee1b5590456d8c31d251b14 100644
--- a/ghc/compiler/stgSyn/StgLint.lhs
+++ b/ghc/compiler/stgSyn/StgLint.lhs
@@ -22,7 +22,6 @@ import ErrUtils		( ErrMsg, Message, addErrLocHdrLine, pprBagOfErrors, dontAddErr
 import Type		( mkFunTys, splitFunTys, splitAlgTyConApp_maybe, 
 			  isUnLiftedType, isTyVarTy, splitForAllTys, Type
 			)
-import PprType		( {- instance Outputable Type -} )
 import TyCon		( TyCon, isDataTyCon )
 import Util		( zipEqual )
 import Outputable
diff --git a/ghc/compiler/stgSyn/StgSyn.lhs b/ghc/compiler/stgSyn/StgSyn.lhs
index fabedee554482bedd91b8a0ed98cda1fd7923e3f..2f0fc0b507d9476c85ea6f21d864ea832d77b444 100644
--- a/ghc/compiler/stgSyn/StgSyn.lhs
+++ b/ghc/compiler/stgSyn/StgSyn.lhs
@@ -48,12 +48,10 @@ import CostCentre	( CostCentreStack, CostCentre )
 import Id		( Id, idName, idPrimRep, idType )
 import Name		( isDllName )
 import Literal		( Literal, literalType, isLitLitLit, literalPrimRep )
-import DataCon		( DataCon, dataConName, isNullaryDataCon )
+import DataCon		( DataCon, dataConName )
 import PrimOp		( PrimOp )
-import PrimRep		( PrimRep(..) )
 import Outputable
 import Type             ( Type )
-import PprType		( {- instance Outputable Type -} )
 import UniqSet		( isEmptyUniqSet, uniqSetToList, UniqSet )
 \end{code}
 
diff --git a/ghc/compiler/stranal/SaLib.lhs b/ghc/compiler/stranal/SaLib.lhs
index f3d5dc8fc92f214702ba3a5e7a9493cbd67cbb13..7e485c909780eeca6ceeb6dc78fc7f6833e493c1 100644
--- a/ghc/compiler/stranal/SaLib.lhs
+++ b/ghc/compiler/stranal/SaLib.lhs
@@ -18,9 +18,7 @@ module SaLib (
 
 #include "HsVersions.h"
 
-import Id		( Id )
 import Type		( Type )
-import CoreSyn		( CoreExpr )
 import VarEnv
 import IdInfo		( StrictnessInfo(..) )
 import Demand		( Demand, pprDemands )
diff --git a/ghc/compiler/stranal/StrictAnal.lhs b/ghc/compiler/stranal/StrictAnal.lhs
index 032176a6e1dd116a7f865383e7dcff3684c8e709..15520cbec9d5534a2321888c5f552e5898cee062 100644
--- a/ghc/compiler/stranal/StrictAnal.lhs
+++ b/ghc/compiler/stranal/StrictAnal.lhs
@@ -13,7 +13,7 @@ module StrictAnal ( saBinds ) where
 
 import CmdLineOpts	( opt_D_dump_stranal, opt_D_dump_simpl_stats,  opt_D_verbose_core2core )
 import CoreSyn
-import Id		( idType, setIdStrictness, setInlinePragma, 
+import Id		( setIdStrictness, setInlinePragma, 
 			  idDemandInfo, setIdDemandInfo, isBottomingId,
 			  Id
 			)
@@ -23,7 +23,6 @@ import ErrUtils		( dumpIfSet )
 import SaAbsInt
 import SaLib
 import Demand		( Demand, wwStrict, isStrict, isLazy )
-import UniqSupply       ( UniqSupply )
 import Util		( zipWith3Equal, stretchZipWith )
 import Outputable
 \end{code}
diff --git a/ghc/compiler/stranal/WorkWrap.lhs b/ghc/compiler/stranal/WorkWrap.lhs
index 87f560b575900434f8dc43628c607224cacdab7b..0ad75460de48170fb3d3a42be47e1824b47cdce7 100644
--- a/ghc/compiler/stranal/WorkWrap.lhs
+++ b/ghc/compiler/stranal/WorkWrap.lhs
@@ -15,21 +15,17 @@ import CmdLineOpts	( opt_UF_CreationThreshold , opt_D_verbose_core2core,
 			)
 import CoreLint		( beginPass, endPass )
 import CoreUtils	( exprType, exprArity, exprEtaExpandArity )
-import DataCon		( DataCon )
 import MkId		( mkWorkerId )
 import Id		( Id, idType, idStrictness, setIdArityInfo, isOneShotLambda,
 			  setIdStrictness, idInlinePragma, 
 			  setIdWorkerInfo, idCprInfo, setInlinePragma )
-import VarSet
 import Type		( Type, isNewType, splitForAllTys, splitFunTys )
 import IdInfo		( mkStrictnessInfo, noStrictnessInfo, StrictnessInfo(..),
 			  CprInfo(..), exactArity, InlinePragInfo(..), isNeverInlinePrag,
 			  WorkerInfo(..)
 			)
 import Demand           ( Demand, wwLazy )
-import SaLib
 import UniqSupply	( UniqSupply, initUs_, returnUs, thenUs, mapUs, getUniqueUs, UniqSM )
-import UniqSet
 import WwLib
 import Outputable
 \end{code}
diff --git a/ghc/compiler/stranal/WwLib.lhs b/ghc/compiler/stranal/WwLib.lhs
index 9083d37f81d351e58a8799eb38da5c4ab9d7824f..f15643046186485ddd6a4c2a020a9577f4a2f121 100644
--- a/ghc/compiler/stranal/WwLib.lhs
+++ b/ghc/compiler/stranal/WwLib.lhs
@@ -29,7 +29,6 @@ import Type		( isUnLiftedType,
 			  mkTyConApp, mkFunTys,
 			  Type
 			)
-import TyCon            ( isNewTyCon, isProductTyCon, TyCon )
 import BasicTypes	( NewOrData(..), Arity, Boxity(..) )
 import Var              ( TyVar, Var, isId )
 import UniqSupply	( returnUs, thenUs, getUniqueUs, getUniquesUs, 
diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs
index 1e99572c5e8b809c5cf3a70a23c463d3b3fc4443..f3b13c803e2426e8f80409184f5fc748443a871d 100644
--- a/ghc/compiler/typecheck/Inst.lhs
+++ b/ghc/compiler/typecheck/Inst.lhs
@@ -38,7 +38,6 @@ module Inst (
 #include "HsVersions.h"
 
 import HsSyn	( HsLit(..), HsExpr(..) )
-import RnHsSyn	( RenamedArithSeqInfo, RenamedHsExpr, RenamedPat )
 import TcHsSyn	( TcExpr, TcId, 
 		  mkHsTyApp, mkHsDictApp, mkHsConApp, zonkId
 		)
@@ -59,7 +58,6 @@ import PrelInfo	( isStandardClass, isCcallishClass, isNoDictClass )
 import Name	( OccName, Name, mkDictOcc, mkMethodOcc, mkIPOcc,
 		  getOccName, nameUnique )
 import PprType	( pprPred )	
-import SrcLoc	( SrcLoc )
 import Type	( Type, PredType(..), ThetaType,
 		  mkTyVarTy, isTyVarTy, mkDictTy, mkPredTy,
 		  splitForAllTys, splitSigmaTy,
@@ -69,9 +67,7 @@ import Type	( Type, PredType(..), ThetaType,
 import Subst	( emptyInScopeSet, mkSubst,
 		  substTy, substClasses, mkTyVarSubst, mkTopTyVarSubst
 		)
-import TyCon	( TyCon )
 import Literal	( inIntRange )
-import Var	( TyVar )
 import VarEnv	( lookupVarEnv, TidyEnv,
 		  lookupSubstEnv, SubstResult(..)
 		)
@@ -86,7 +82,6 @@ import TysWiredIn ( intDataCon, isIntTy,
 import Unique	( fromRationalClassOpKey, rationalTyConKey,
 		  fromIntClassOpKey, fromIntegerClassOpKey, Unique
 		)
-import Maybes	( expectJust )
 import Maybe	( catMaybes )
 import Util	( thenCmp, zipWithEqual, mapAccumL )
 import Outputable
diff --git a/ghc/compiler/typecheck/TcBinds.lhs b/ghc/compiler/typecheck/TcBinds.lhs
index 48279327b8d70cda85b81b95a86b20fc653cbd76..7d8b4c3b0312c48a0a9d01ed813d8b30e3b4c73d 100644
--- a/ghc/compiler/typecheck/TcBinds.lhs
+++ b/ghc/compiler/typecheck/TcBinds.lhs
@@ -61,7 +61,6 @@ import Maybes		( maybeToBool )
 import BasicTypes	( TopLevelFlag(..), RecFlag(..), isNotTopLevel )
 import FiniteMap	( listToFM, lookupFM )
 import Unique		( ioTyConKey, mainKey, hasKey, Uniquable(..) )
-import SrcLoc           ( SrcLoc )
 import Outputable
 \end{code}
 
diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs
index 1af35c735d2bf98f955182ba9c3384cd5706d263..eae1c69d277a5a815e4779ab123267aca08a60b4 100644
--- a/ghc/compiler/typecheck/TcClassDcl.lhs
+++ b/ghc/compiler/typecheck/TcClassDcl.lhs
@@ -17,7 +17,6 @@ import HsSyn		( HsDecl(..), TyClDecl(..), Sig(..), MonoBinds(..),
 			  andMonoBinds, andMonoBindList, getTyVarName, 
 			  isClassDecl, isClassOpSig, isPragSig, collectMonoBinders
 			)
-import HsPragmas	( ClassPragmas(..) )
 import BasicTypes	( NewOrData(..), TopLevelFlag(..), RecFlag(..) )
 import RnHsSyn		( RenamedTyClDecl, RenamedClassPragmas,
 			  RenamedClassOpSig, RenamedMonoBinds,
@@ -32,7 +31,6 @@ import TcEnv		( TcId, ValueEnv, TcTyThing(..), tcAddImportedIdInfo,
 			)
 import TcBinds		( tcBindWithSigs, tcSpecSigs )
 import TcTyDecls	( mkNewTyConRep )
-import TcUnify		( unifyKinds )
 import TcMonad
 import TcMonoType	( kcHsType, tcHsTopType, tcExtendTopTyVarScope, 
 			  tcContext, checkSigTyVars, sigCtxt, mkTcSig
@@ -41,15 +39,12 @@ import TcSimplify	( tcSimplifyAndCheck, bindInstsOfLocalFuns )
 import TcType		( TcType, TcTyVar, tcInstTyVars, zonkTcTyVarBndr, tcGetTyVar )
 import TcInstUtil	( classDataCon )
 import PrelInfo		( nO_METHOD_BINDING_ERROR_ID )
-import FieldLabel	( firstFieldLabelTag )
 import Bag		( unionManyBags, bagToList )
 import Class		( mkClass, classBigSig, classSelIds, Class, ClassOpItem )
 import CmdLineOpts      ( opt_GlasgowExts, opt_WarnMissingMethods )
 import MkId		( mkDictSelId, mkDataConId, mkDataConWrapId, mkDefaultMethodId )
 import DataCon		( mkDataCon, dataConId, dataConWrapId, notMarkedStrict )
 import Id		( Id, setInlinePragma, idUnfolding, idType, idName )
-import CoreUnfold	( unfoldingTemplate )
-import IdInfo
 import Name		( Name, nameOccName, isLocallyDefined, NamedThing(..) )
 import NameSet		( emptyNameSet )
 import Outputable
@@ -61,8 +56,6 @@ import Type		( Type, ThetaType, ClassContext,
 import Var		( tyVarKind, TyVar )
 import VarSet		( mkVarSet, emptyVarSet )
 import TyCon		( AlgTyConFlavour(..), mkClassTyCon )
-import Unique		( Unique, Uniquable(..) )
-import Util
 import Maybes		( seqMaybe )
 import FiniteMap        ( lookupWithDefaultFM )
 \end{code}
diff --git a/ghc/compiler/typecheck/TcDefaults.lhs b/ghc/compiler/typecheck/TcDefaults.lhs
index a3c292b82368ab392ef43638917fcc3a37f0480c..aaed7c2221a0bd0fbdd81e8a3878d877f785ee7d 100644
--- a/ghc/compiler/typecheck/TcDefaults.lhs
+++ b/ghc/compiler/typecheck/TcDefaults.lhs
@@ -19,9 +19,7 @@ import TcSimplify	( tcSimplifyCheckThetas )
 import TysWiredIn	( integerTy, doubleTy )
 import Type             ( Type )
 import Unique		( numClassKey )
-import ErrUtils		( addShortErrLocLine )
 import Outputable
-import Util
 \end{code}
 
 \begin{code}
diff --git a/ghc/compiler/typecheck/TcDeriv.lhs b/ghc/compiler/typecheck/TcDeriv.lhs
index a5ef4d81d1a1c5a2e5288c276cba116b8c8382c4..44a0c5ee8ed4b7b8a4036726ab92c7c72b0e97dd 100644
--- a/ghc/compiler/typecheck/TcDeriv.lhs
+++ b/ghc/compiler/typecheck/TcDeriv.lhs
@@ -50,7 +50,6 @@ import Type		( TauType, mkTyVarTys, mkTyConApp,
 			  mkSigmaTy, mkDictTy, isUnboxedType,
 			  splitAlgTyConApp, classesToPreds
 			)
-import PprType		( {- instance Outputable Type -} )
 import TysWiredIn	( voidTy )
 import Var		( TyVar )
 import Unique		-- Keys stuff
diff --git a/ghc/compiler/typecheck/TcEnv.lhs b/ghc/compiler/typecheck/TcEnv.lhs
index db0d64f43223c9fbe9901ad4a4284c075bdcb644..30999e89c20696274266f7c07adf17e83254621f 100644
--- a/ghc/compiler/typecheck/TcEnv.lhs
+++ b/ghc/compiler/typecheck/TcEnv.lhs
@@ -36,7 +36,6 @@ module TcEnv(
 
 #include "HsVersions.h"
 
-import HsTypes	( HsTyVarBndr, getTyVarName )
 import Id	( mkUserLocal, isDataConWrapId_maybe )
 import MkId 	( mkSpecPragmaId )
 import Var	( TyVar, Id, setVarName,
@@ -46,7 +45,6 @@ import TcType	( TcType, TcTyVar, TcTyVarSet, TcThetaType,
 		  tcInstTyVars, zonkTcTyVars,
 		  TcKind, kindToTcKind
 		)
-import VarEnv
 import VarSet
 import Type	( Kind, Type, superKind,
 		  tyVarsOfType, tyVarsOfTypes, mkTyVarTy,
@@ -71,11 +69,9 @@ import Name		( Name, OccName, nameOccName, getSrcLoc,
 			)
 import Unify		( unifyTyListsX, matchTys )
 import Unique		( pprUnique10, Unique, Uniquable(..) )
-import FiniteMap	( lookupFM, addToFM )
 import UniqFM
 import Unique		( Uniquable(..) )
 import Util		( zipEqual, zipWith3Equal, mapAccumL )
-import Bag		( bagToList )
 import SrcLoc		( SrcLoc )
 import FastString	( FastString )
 import Maybes
diff --git a/ghc/compiler/typecheck/TcExpr.lhs b/ghc/compiler/typecheck/TcExpr.lhs
index 2bb3060185cbfad70ae948cf93dab0e6ccbb9be6..d171a36d80c12546f18968826e816ceabca55832 100644
--- a/ghc/compiler/typecheck/TcExpr.lhs
+++ b/ghc/compiler/typecheck/TcExpr.lhs
@@ -44,7 +44,6 @@ import TcType		( TcType, TcTauType,
 			  tcInstTcType, tcSplitRhoTy,
 			  newTyVarTy, newTyVarTy_OpenKind, zonkTcType )
 
-import Class		( Class )
 import FieldLabel	( FieldLabel, fieldLabelName, fieldLabelType, fieldLabelTyCon )
 import Id		( idType, recordSelectorFieldLabel, isRecordSelector,
 			  Id, mkVanillaId
diff --git a/ghc/compiler/typecheck/TcForeign.lhs b/ghc/compiler/typecheck/TcForeign.lhs
index aa2434704a190e3c9fba0fe50b89255799d5e170..7e4140799b175208e5fa1e890c4c7edf4baa3ae0 100644
--- a/ghc/compiler/typecheck/TcForeign.lhs
+++ b/ghc/compiler/typecheck/TcForeign.lhs
@@ -33,7 +33,6 @@ import TcHsSyn		( TcMonoBinds, TypecheckedForeignDecl,
 			  TcForeignExportDecl )
 import TcExpr		( tcId, tcPolyExpr )			
 import Inst		( emptyLIE, LIE, plusLIE )
-import CoreSyn
 
 import ErrUtils		( Message )
 import Id		( Id, idName, mkVanillaId )
@@ -42,16 +41,12 @@ import Type		( splitFunTys
 			, splitTyConApp_maybe
 			, splitForAllTys
 			)
-import PprType		( {- instance Outputable Type -} )
 import TysWiredIn	( isFFIArgumentTy, isFFIResultTy, 
 			  isFFIExternalTy, isAddrTy
 			)
 import Type             ( Type )
 import Unique
 import Outputable
-import Util
-import CmdLineOpts	( opt_GlasgowExts )
-import Maybes		( maybeToBool )
 
 \end{code}
 
diff --git a/ghc/compiler/typecheck/TcGenDeriv.lhs b/ghc/compiler/typecheck/TcGenDeriv.lhs
index d216ae6409b74f1ea6de72ba6c3a5298f4f6ed52..b19f84e434b094defafcafdf0966f38a1b2d24b4 100644
--- a/ghc/compiler/typecheck/TcGenDeriv.lhs
+++ b/ghc/compiler/typecheck/TcGenDeriv.lhs
@@ -49,7 +49,6 @@ import Name		( getOccString, getOccName, getSrcLoc, occNameString,
 			  isDataSymOcc, isSymOcc
 			)
 
-import PrimOp		( PrimOp(..) )
 import PrelInfo		-- Lots of RdrNames
 import SrcLoc		( mkGeneratedSrcLoc, SrcLoc )
 import TyCon		( TyCon, isNewTyCon, tyConDataCons, isEnumerationTyCon,
@@ -65,7 +64,6 @@ import Panic		( panic, assertPanic )
 import Maybes		( maybeToBool )
 import Constants
 import List		( partition, intersperse )
-import Char		( isAlpha )
 
 #if __GLASGOW_HASKELL__ >= 404
 import GlaExts		( fromInt )
diff --git a/ghc/compiler/typecheck/TcHsSyn.lhs b/ghc/compiler/typecheck/TcHsSyn.lhs
index c45fab75016e498ee6aecec05770ff9a19053402..1252cfd913dec93742809473c73950a1ef2ba6af 100644
--- a/ghc/compiler/typecheck/TcHsSyn.lhs
+++ b/ghc/compiler/typecheck/TcHsSyn.lhs
@@ -49,16 +49,11 @@ import TcMonad
 import TcType	( TcType, TcTyVar,
 		  zonkTcTypeToType, zonkTcTyVarToTyVar, zonkTcTyVarBndr, zonkTcType
 		)
-import Type	( mkTyVarTy, isUnLiftedType, Type )
 import Name	( isLocallyDefined )
-import Var	( TyVar )
-import VarEnv	( TyVarEnv, emptyVarEnv, extendVarEnvList )
-import VarSet	( isEmptyVarSet )
 import CoreSyn  ( Expr )
 import CoreUnfold( unfoldingTemplate )
 import BasicTypes ( RecFlag(..) )
 import Bag
-import UniqFM
 import Outputable
 \end{code}
 
diff --git a/ghc/compiler/typecheck/TcIfaceSig.lhs b/ghc/compiler/typecheck/TcIfaceSig.lhs
index 56d74688f5444e2e625b913612bf0ebeb7573b68..27b4f1845fca6aaa15b1ad9074d0152c0f9b92df 100644
--- a/ghc/compiler/typecheck/TcIfaceSig.lhs
+++ b/ghc/compiler/typecheck/TcIfaceSig.lhs
@@ -21,7 +21,6 @@ import TcEnv		( ValueEnv, tcExtendTyVarEnv,
 			  tcLookupValueMaybe,
 			  explicitLookupValue, badCon, badPrimOp, valueEnvIds
 			)
-import TcType		( TcKind, kindToTcKind )
 
 import RnHsSyn		( RenamedHsDecl )
 import HsCore
@@ -31,7 +30,6 @@ import CoreUtils	( exprType )
 import CoreUnfold
 import CoreLint		( lintUnfolding )
 import WorkWrap		( mkWrapper )
-import PrimOp		( PrimOp(..) )
 
 import Id		( Id, mkId, mkVanillaId,
 			  isDataConWrapId_maybe
@@ -41,12 +39,9 @@ import IdInfo
 import DataCon		( dataConSig, dataConArgTys )
 import Type		( mkSynTy, mkTyVarTys, splitAlgTyConApp, splitAlgTyConApp_maybe, splitFunTys, unUsgTy )
 import Var		( mkTyVar, tyVarKind )
-import VarEnv
 import Name		( Name, NamedThing(..), isLocallyDefined )
-import TysWiredIn	( integerTy, stringTy )
 import Demand		( wwLazy )
 import ErrUtils		( pprBagOfErrors )
-import Maybes		( maybeToBool, MaybeErr(..) )
 import Outputable	
 import Util		( zipWithEqual )
 \end{code}
diff --git a/ghc/compiler/typecheck/TcInstDcls.lhs b/ghc/compiler/typecheck/TcInstDcls.lhs
index a140b9c832e0186c934e487fe98ca7d0670e59b1..e55ea763f1fb13cda7b5037e2b0741f23b2d6c0a 100644
--- a/ghc/compiler/typecheck/TcInstDcls.lhs
+++ b/ghc/compiler/typecheck/TcInstDcls.lhs
@@ -38,7 +38,6 @@ import Bag		( emptyBag, unitBag, unionBags, unionManyBags,
 import CmdLineOpts	( opt_GlasgowExts, opt_AllowUndecidableInstances )
 import Class		( classBigSig, Class )
 import Var		( idName, idType, Id, TyVar )
-import DataCon		( isNullaryDataCon, splitProductType_maybe )
 import Maybes 		( maybeToBool, catMaybes, expectJust )
 import MkId		( mkDictFunId )
 import Module		( ModuleName )
@@ -46,7 +45,6 @@ import Name		( isLocallyDefined, NamedThing(..)	)
 import NameSet		( emptyNameSet )
 import PrelInfo		( eRROR_ID )
 import PprType		( pprConstraint )
-import SrcLoc		( SrcLoc )
 import TyCon		( isSynTyCon, tyConDerivings )
 import Type		( Type, isUnLiftedType, mkTyVarTys,
 			  splitSigmaTy, isTyVarTy,
@@ -57,7 +55,6 @@ import Type		( Type, isUnLiftedType, mkTyVarTys,
 			)
 import Subst		( mkTopTyVarSubst, substClasses )
 import VarSet		( mkVarSet, varSetElems )
-import TysPrim		( byteArrayPrimTyCon, mutableByteArrayPrimTyCon )
 import TysWiredIn	( stringTy, isFFIArgumentTy, isFFIResultTy )
 import Unique		( Unique, cCallableClassKey, cReturnableClassKey, hasKey, Uniquable(..) )
 import Outputable
diff --git a/ghc/compiler/typecheck/TcInstUtil.lhs b/ghc/compiler/typecheck/TcInstUtil.lhs
index 8a83d3da28c7fcc0f00d99270518e7c62062611b..5638cf1acddd1d92ad261f180a345824cbe46086 100644
--- a/ghc/compiler/typecheck/TcInstUtil.lhs
+++ b/ghc/compiler/typecheck/TcInstUtil.lhs
@@ -25,7 +25,7 @@ import Var		( TyVar, Id, idName )
 import Maybes		( MaybeErr(..), mkLookupFunDef )
 import Name		( getSrcLoc, nameModule, isLocallyDefined )
 import SrcLoc		( SrcLoc )
-import Type		( ThetaType, Type, ClassContext )
+import Type		( Type, ClassContext )
 import PprType		( pprConstraint )
 import Class		( classTyCon )
 import DataCon		( DataCon )
diff --git a/ghc/compiler/typecheck/TcMatches.lhs b/ghc/compiler/typecheck/TcMatches.lhs
index ebd6ba56e2bdb9977e6d5993cffe66794c48e099..4d73dbe36bc00ba61c9293b9be1d55be0e6569e6 100644
--- a/ghc/compiler/typecheck/TcMatches.lhs
+++ b/ghc/compiler/typecheck/TcMatches.lhs
@@ -34,7 +34,6 @@ import BasicTypes	( RecFlag(..) )
 import Type		( Kind, tyVarsOfType, isTauTy, mkFunTy, boxedTypeKind )
 import VarSet
 import Var		( Id )
-import Util
 import Bag
 import Outputable
 import List		( nub )
diff --git a/ghc/compiler/typecheck/TcModule.lhs b/ghc/compiler/typecheck/TcModule.lhs
index 142ad99593a43197aaee88503008a00d36cd9aaf..d10c84b307d1586a701c9681ba36a65162a105a2 100644
--- a/ghc/compiler/typecheck/TcModule.lhs
+++ b/ghc/compiler/typecheck/TcModule.lhs
@@ -31,7 +31,6 @@ import TcEnv		( tcExtendGlobalValEnv, tcExtendTypeEnv,
 			  initEnv, 
 			  ValueEnv, TcTyThing(..)
 			)
-import TcExpr		( tcId )
 import TcRules		( tcRules )
 import TcForeign	( tcForeignImports, tcForeignExports )
 import TcIfaceSig	( tcInterfaceSigs )
@@ -56,19 +55,13 @@ import Name		( Name, nameUnique, nameOccName, isLocallyDefined,
 			)
 import TyCon		( TyCon, tyConKind )
 import Class		( Class, classSelIds, classTyCon )
-import Type		( mkTyConApp, mkForAllTy,
-			  boxedTypeKind, getTyVar, Type )
-import TysWiredIn	( unitTy )
 import PrelInfo		( mAIN_Name )
-import TcUnify		( unifyTauTy )
 import Unique		( Unique, mainKey )
 import UniqSupply       ( UniqSupply )
 import Maybes		( maybeToBool )
 import Util
 import Bag		( Bag, isEmptyBag )
 import Outputable
-
-import IOExts
 \end{code}
 
 Outside-world interface:
diff --git a/ghc/compiler/typecheck/TcMonad.lhs b/ghc/compiler/typecheck/TcMonad.lhs
index a4d8ef1a1db415a182adea60e295ea56fe0a1d48..8e4b1906250f853915af69ebbfdfb16250f635a0 100644
--- a/ghc/compiler/typecheck/TcMonad.lhs
+++ b/ghc/compiler/typecheck/TcMonad.lhs
@@ -49,7 +49,6 @@ import HsSyn		( HsLit )
 import RnHsSyn		( RenamedPat, RenamedArithSeqInfo, RenamedHsExpr )
 import Type		( Type, Kind, PredType, ThetaType, RhoType, TauType,
 			)
-import PprType		( {- instance Outputable Type -} )
 import ErrUtils		( addShortErrLocLine, addShortWarnLocLine, pprBagOfErrors, ErrMsg, Message, WarnMsg )
 import CmdLineOpts      ( opt_PprStyle_Debug )
 
@@ -63,11 +62,9 @@ import VarSet		( TyVarSet )
 import UniqSupply	( UniqSupply, uniqFromSupply, uniqsFromSupply, splitUniqSupply,
 			  UniqSM, initUs_ )
 import SrcLoc		( SrcLoc, noSrcLoc )
-import FiniteMap	( FiniteMap, emptyFM )
 import UniqFM		( UniqFM, emptyUFM )
 import Unique		( Unique )
 import BasicTypes	( Unused )
-import Util
 import Outputable
 import FastString	( FastString )
 
diff --git a/ghc/compiler/typecheck/TcMonoType.lhs b/ghc/compiler/typecheck/TcMonoType.lhs
index c5356849360e6dfc75056fc528f836b4d04600ce..f734b782368269c8f927db908a9543c111ad1911 100644
--- a/ghc/compiler/typecheck/TcMonoType.lhs
+++ b/ghc/compiler/typecheck/TcMonoType.lhs
@@ -48,15 +48,12 @@ import Id		( mkVanillaId, idName, idType, idFreeTyVars )
 import Var		( TyVar, mkTyVar, mkNamedUVar, varName )
 import VarEnv
 import VarSet
-import Bag		( bagToList )
 import ErrUtils		( Message )
-import TyCon		( TyCon )
 import Name		( Name, OccName, isLocallyDefined )
 import TysWiredIn	( mkListTy, mkTupleTy )
 import UniqFM		( elemUFM, foldUFM )
 import BasicTypes	( Boxity(..) )
 import SrcLoc		( SrcLoc )
-import Unique		( Unique, Uniquable(..) )
 import Util		( mapAccumL, isSingleton, removeDups )
 import Outputable
 \end{code}
diff --git a/ghc/compiler/typecheck/TcPat.lhs b/ghc/compiler/typecheck/TcPat.lhs
index f5045e409bc4bf20bc38af5a9f072b20e55dd8cb..e974cfaa2d9c397459dd5ec7fdc090e12d2083d7 100644
--- a/ghc/compiler/typecheck/TcPat.lhs
+++ b/ghc/compiler/typecheck/TcPat.lhs
@@ -8,8 +8,6 @@ module TcPat ( tcPat, tcPatBndr_NoSigs, badFieldCon, polyPatSig ) where
 
 #include "HsVersions.h"
 
-import {-# SOURCE #-}	TcExpr( tcExpr )
-
 import HsSyn		( InPat(..), OutPat(..), HsLit(..), HsExpr(..), Sig(..) )
 import RnHsSyn		( RenamedPat )
 import TcHsSyn		( TcPat, TcId )
@@ -34,13 +32,11 @@ import DataCon		( DataCon, dataConSig, dataConFieldLabels,
 			)
 import Id		( Id, idType, isDataConWrapId_maybe )
 import Type		( Type, isTauTy, mkTyConApp, mkClassPred, boxedTypeKind )
-import PprType		( {- instance Outputable Type -} )
 import Subst		( substTy, substClasses )
 import TysPrim		( charPrimTy, intPrimTy, floatPrimTy,
 			  doublePrimTy, addrPrimTy
 			)
 import TysWiredIn	( charTy, stringTy, intTy )
-import SrcLoc		( SrcLoc )
 import Unique		( eqClassOpKey, geClassOpKey, minusClassOpKey,
 			  cCallableClassKey
 			)
diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs
index 3f7c2a29e46cdc4a950aea002df3b1fef97c91a1..861f908f5d620c5874683df4c899d7410af34435 100644
--- a/ghc/compiler/typecheck/TcSimplify.lhs
+++ b/ghc/compiler/typecheck/TcSimplify.lhs
@@ -161,7 +161,6 @@ import PprType		( pprConstraint )
 import TysWiredIn	( unitTy )
 import VarSet
 import FiniteMap
-import BasicTypes	( TopLevelFlag(..) )
 import CmdLineOpts	( opt_GlasgowExts )
 import Outputable
 import Util
diff --git a/ghc/compiler/typecheck/TcTyClsDecls.lhs b/ghc/compiler/typecheck/TcTyClsDecls.lhs
index bf8baadcade667c046d3c1e7ddc13a70157e8c08..030e7102133bf430886267399f954ef2485d4157 100644
--- a/ghc/compiler/typecheck/TcTyClsDecls.lhs
+++ b/ghc/compiler/typecheck/TcTyClsDecls.lhs
@@ -30,11 +30,8 @@ import TcType		( TcKind, newKindVar, newKindVars, kindToTcKind, zonkTcKindToKind
 
 import Type		( mkArrowKind, boxedTypeKind )
 
-import Class		( Class )
-import Var		( TyVar, tyVarKind )
 import FiniteMap
 import Bag	
-import VarSet
 import Digraph		( stronglyConnComp, SCC(..) )
 import Name		( Name, NamedThing(..), getSrcLoc, isTvOcc, nameOccName )
 import Outputable
@@ -43,7 +40,6 @@ import UniqSet		( UniqSet, emptyUniqSet,
 			  unitUniqSet, unionUniqSets, 
 			  unionManyUniqSets, uniqSetToList ) 
 import ErrUtils		( Message )
-import SrcLoc		( SrcLoc )
 import TyCon		( TyCon, ArgVrcs )
 import Variance         ( calcTyConArgVrcs )
 import Unique		( Unique, Uniquable(..) )
diff --git a/ghc/compiler/typecheck/TcTyDecls.lhs b/ghc/compiler/typecheck/TcTyDecls.lhs
index a6f151d3b8dc3e62df7d1db57ffc3fdae47b42b8..464d1b6240248092456290c4277e3d7d07558f54 100644
--- a/ghc/compiler/typecheck/TcTyDecls.lhs
+++ b/ghc/compiler/typecheck/TcTyDecls.lhs
@@ -55,7 +55,6 @@ import VarSet		( intersectVarSet, isEmptyVarSet )
 import Unique		( unpackCStringIdKey )
 import Util		( equivClasses )
 import FiniteMap        ( FiniteMap, lookupWithDefaultFM )
-import CmdLineOpts	( opt_GlasgowExts )
 \end{code}
 
 %************************************************************************
diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs
index dd48b71b60f19936d30c5a168ce97ffbd2ef19f7..81b4ee8ecd4be4fcb560116402f2474d88b26f0c 100644
--- a/ghc/compiler/typecheck/TcType.lhs
+++ b/ghc/compiler/typecheck/TcType.lhs
@@ -51,7 +51,6 @@ module TcType (
 
 
 -- friends:
-import PprType		( pprType )
 import TypeRep		( Type(..), Kind, TyNote(..), 
 			  typeCon, openTypeKind, boxedTypeKind, boxedKind, superKind, superBoxity
 			)  -- friend
@@ -63,8 +62,6 @@ import Type		( ThetaType, PredType(..),
 import Subst		( Subst, mkTopTyVarSubst, substTy )
 import TyCon		( tyConKind, mkPrimTyCon )
 import PrimRep		( PrimRep(VoidRep) )
-import VarEnv
-import VarSet		( emptyVarSet )
 import Var		( TyVar, tyVarKind, tyVarName, isTyVar, isMutTyVar, mkTyVar )
 
 -- others:
diff --git a/ghc/compiler/typecheck/TcUnify.lhs b/ghc/compiler/typecheck/TcUnify.lhs
index 9d684c19992d306f1ed11a97d604f8cba9b88113..ba131c09d5a33afa9a1df03a72f065a6ddd10eef 100644
--- a/ghc/compiler/typecheck/TcUnify.lhs
+++ b/ghc/compiler/typecheck/TcUnify.lhs
@@ -28,17 +28,15 @@ import Type	( tyVarsOfType,
 import TyCon	( TyCon, isTupleTyCon, tupleTyConBoxity, tyConArity )
 import Name	( hasBetterProv )
 import Var	( TyVar, tyVarKind, varName, isSigTyVar )
-import VarEnv	
 import VarSet	( varSetElems )
 import TcType	( TcType, TcTauType, TcTyVar, TcKind, 
 		  newTyVarTy, newOpenTypeKind, newTyVarTy_OpenKind,
 		  tcGetTyVar, tcPutTyVar, zonkTcType, tcTypeKind
 		)
+
 -- others:
 import BasicTypes ( Arity, Boxity, isBoxed )
 import TysWiredIn ( listTyCon, mkListTy, mkTupleTy )
-import PprType	()		-- Instances
-import Util
 import Outputable
 \end{code}
 
diff --git a/ghc/compiler/types/PprType.lhs b/ghc/compiler/types/PprType.lhs
index 93742231b17cb7e8a4d00e2ad3ddb78bdc20b780..00ff1e872010de91294b2e5aaeee1195ea72f8a6 100644
--- a/ghc/compiler/types/PprType.lhs
+++ b/ghc/compiler/types/PprType.lhs
@@ -30,7 +30,6 @@ import Type		( PredType(..), ThetaType,
 import Var		( TyVar, tyVarKind,
 			  tyVarName, setTyVarName
 			)
-import VarEnv
 import TyCon		( TyCon, isPrimTyCon, isTupleTyCon, isUnboxedTupleTyCon, 
 			  maybeTyConSingleCon, isEnumerationTyCon, 
 			  tyConArity, tyConUnique
@@ -44,7 +43,6 @@ import Outputable
 import PprEnv
 import Unique		( Uniquable(..) )
 import Unique		-- quite a few *Keys
-import Util
 \end{code}
 
 %************************************************************************
diff --git a/ghc/compiler/types/Unify.lhs b/ghc/compiler/types/Unify.lhs
index f5f6111473e1dc50c486771759c99ce020b0d813..756a5ed31439938b4db709d04ab8662049b5b8d9 100644
--- a/ghc/compiler/types/Unify.lhs
+++ b/ghc/compiler/types/Unify.lhs
@@ -27,7 +27,6 @@ import VarEnv	( TyVarSubstEnv, emptySubstEnv, lookupSubstEnv, extendSubstEnv,
 		  SubstResult(..)
 		)
 
-import Unique	( Uniquable(..) )
 import Outputable( panic )
 import Util	( snocView )
 \end{code}
diff --git a/ghc/compiler/usageSP/UConSet.lhs b/ghc/compiler/usageSP/UConSet.lhs
index 674bbd8b6820bf8a4c08061651f1f49dca814f6d..2c5cc0038a3067ac0f3859c23272a8d4ce98c7ac 100644
--- a/ghc/compiler/usageSP/UConSet.lhs
+++ b/ghc/compiler/usageSP/UConSet.lhs
@@ -24,7 +24,6 @@ module UConSet ( UConSet,
 import VarEnv
 import Type		( UsageAnn(..) )
 import Var		( UVar )
-import Monad		( foldM )
 import Bag              ( Bag, unitBag, emptyBag, unionBags, foldlBag, bagToList )
 import Outputable
 import PprType
diff --git a/ghc/compiler/usageSP/UsageSPInf.lhs b/ghc/compiler/usageSP/UsageSPInf.lhs
index b0f5f56b52e029e0a088971cb6db8d68aab61db2..bfd5e71307d1d0f2a45f99d6c9400ed5e26dcbd8 100644
--- a/ghc/compiler/usageSP/UsageSPInf.lhs
+++ b/ghc/compiler/usageSP/UsageSPInf.lhs
@@ -27,13 +27,11 @@ import Type             ( UsageAnn(..),
                           mkUsgTy, splitUsgTy, isUsgTy, isNotUsgTy, unUsgTy, tyUsg,
                           splitUsForAllTys, substUsTy,
                           mkFunTy, mkForAllTy )
-import PprType		( {- instance Outputable Type -} )
 import TyCon            ( tyConArgVrcs_maybe, isFunTyCon )
 import Literal          ( Literal(..), literalType )
 import Var              ( Var, UVar, varType, setVarType, mkUVar, modifyIdInfo )
 import IdInfo           ( setLBVarInfo, LBVarInfo(..) )
 import Id               ( isExportedId )
-import Name             ( isLocallyDefined )
 import VarEnv
 import VarSet
 import UniqSupply       ( UniqSupply, UniqSM,
diff --git a/ghc/compiler/usageSP/UsageSPLint.lhs b/ghc/compiler/usageSP/UsageSPLint.lhs
index 1c97ffc02196d291884f283b60251dd10f63cd0f..6fb6b058a23d1d4c172c20429dec6b3cd27f930c 100644
--- a/ghc/compiler/usageSP/UsageSPLint.lhs
+++ b/ghc/compiler/usageSP/UsageSPLint.lhs
@@ -21,15 +21,12 @@ import UsageSPUtils
 import CoreSyn
 import TypeRep          ( Type(..), TyNote(..) )  -- friend
 import Type             ( UsageAnn(..), isUsgTy, tyUsg )
-import PprType		( {- instance Outputable Type -} )
 import TyCon            ( isAlgTyCon, isPrimTyCon, isSynTyCon, isFunTyCon )
 import Var              ( Var, varType )
 import Id		( idLBVarInfo )
 import IdInfo           ( LBVarInfo(..) )
-import SrcLoc           ( noSrcLoc )
-import ErrUtils         ( Message, ghcExit )
+import ErrUtils         ( ghcExit )
 import Util             ( zipWithEqual )
-import PprCore
 import Bag
 import Outputable
 \end{code}
diff --git a/ghc/compiler/usageSP/UsageSPUtils.lhs b/ghc/compiler/usageSP/UsageSPUtils.lhs
index 4fb51f0eebb78fb962d26c357344250a8bb35b1c..92467090afc5423333da5696775b4153ee0d86cf 100644
--- a/ghc/compiler/usageSP/UsageSPUtils.lhs
+++ b/ghc/compiler/usageSP/UsageSPUtils.lhs
@@ -26,21 +26,17 @@ module UsageSPUtils ( AnnotM(AnnotM), initAnnotM,
 
 import CoreSyn
 import CoreFVs		( mustHaveLocalBinding )
-import Literal          ( Literal(..) )
 import Var              ( Var, varName, varType, setVarType, mkUVar )
 import Id               ( isExportedId )
 import Name             ( isLocallyDefined )
 import TypeRep          ( Type(..), TyNote(..) )  -- friend
 import Type             ( UsageAnn(..), isUsgTy, splitFunTys )
-import PprType		( {- instance Outputable Type -} )
 import Subst		( substTy, mkTyVarSubst )
 import TyCon            ( isAlgTyCon, isPrimTyCon, isSynTyCon, isFunTyCon )
 import VarEnv
 import PrimOp           ( PrimOp, primOpUsg )
-import Maybes           ( expectJust )
 import UniqSupply       ( UniqSupply, UniqSM, initUs, getUniqueUs, thenUs, returnUs )
 import Outputable
-import PprCore          ( )  -- instances only
 \end{code}
 
 ======================================================================