summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-07-07 12:15:48 +0000
committerIan Lynagh <igloo@earth.li>2009-07-07 12:15:48 +0000
commit703ca1542c8e0983cc9d8eebce6e9f3dd3fd71e2 (patch)
tree3bc691cef188bfe99017ed25882ed45635f851fe /compiler
parent7bb3d1fc79521d591cd9f824893963141a7997b6 (diff)
downloadhaskell-703ca1542c8e0983cc9d8eebce6e9f3dd3fd71e2.tar.gz
Remove unused imports
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/MkId.lhs3
-rw-r--r--compiler/cmm/CmmBuildInfoTables.hs2
-rw-r--r--compiler/cmm/CmmCPS.hs2
-rw-r--r--compiler/cmm/CmmCPSGen.hs1
-rw-r--r--compiler/cmm/CmmCallConv.hs1
-rw-r--r--compiler/cmm/CmmCvt.hs4
-rw-r--r--compiler/cmm/CmmProcPointZ.hs2
-rw-r--r--compiler/cmm/CmmSpillReload.hs2
-rw-r--r--compiler/cmm/CmmStackLayout.hs1
-rw-r--r--compiler/cmm/DFMonad.hs1
-rw-r--r--compiler/cmm/PprCmmZ.hs1
-rw-r--r--compiler/cmm/ZipDataflow.hs2
-rw-r--r--compiler/codeGen/CgCon.lhs2
-rw-r--r--compiler/codeGen/CgInfoTbls.hs1
-rw-r--r--compiler/codeGen/CgLetNoEscape.lhs1
-rw-r--r--compiler/codeGen/CgProf.hs1
-rw-r--r--compiler/codeGen/CodeGen.lhs1
-rw-r--r--compiler/codeGen/StgCmm.hs1
-rw-r--r--compiler/codeGen/StgCmmBind.hs2
-rw-r--r--compiler/codeGen/StgCmmClosure.hs1
-rw-r--r--compiler/codeGen/StgCmmEnv.hs1
-rw-r--r--compiler/codeGen/StgCmmHeap.hs1
-rw-r--r--compiler/codeGen/StgCmmLayout.hs1
-rw-r--r--compiler/codeGen/StgCmmProf.hs1
-rw-r--r--compiler/codeGen/StgCmmUtils.hs1
-rw-r--r--compiler/coreSyn/CoreArity.lhs3
-rw-r--r--compiler/coreSyn/CoreTidy.lhs1
-rw-r--r--compiler/coreSyn/MkCore.lhs1
-rw-r--r--compiler/deSugar/Coverage.lhs1
-rw-r--r--compiler/deSugar/DsBinds.lhs1
-rw-r--r--compiler/deSugar/DsCCall.lhs1
-rw-r--r--compiler/deSugar/DsExpr.lhs1
-rw-r--r--compiler/deSugar/DsMeta.hs1
-rw-r--r--compiler/deSugar/DsMonad.lhs2
-rw-r--r--compiler/deSugar/MatchCon.lhs1
-rw-r--r--compiler/deSugar/MatchLit.lhs2
-rw-r--r--compiler/ghci/ByteCodeAsm.lhs10
-rw-r--r--compiler/ghci/Linker.lhs2
-rw-r--r--compiler/hsSyn/HsLit.lhs1
-rw-r--r--compiler/iface/BinIface.hs2
-rw-r--r--compiler/iface/BuildTyCl.lhs3
-rw-r--r--compiler/iface/IfaceEnv.lhs1
-rw-r--r--compiler/iface/LoadIface.lhs5
-rw-r--r--compiler/iface/MkIface.lhs3
-rw-r--r--compiler/iface/TcIface.lhs2
-rw-r--r--compiler/main/CodeOutput.lhs1
-rw-r--r--compiler/main/Finder.lhs2
-rw-r--r--compiler/main/GHC.hs1
-rw-r--r--compiler/main/HscTypes.lhs4
-rw-r--r--compiler/main/PprTyThing.hs1
-rw-r--r--compiler/main/SysTools.lhs1
-rw-r--r--compiler/main/TidyPgm.lhs2
-rw-r--r--compiler/nativeGen/Reg.hs1
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Coalesce.hs1
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Main.hs1
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Spill.hs1
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/SpillClean.hs1
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/SpillCost.hs1
-rw-r--r--compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs1
-rw-r--r--compiler/nativeGen/SPARC/Instr.hs2
-rw-r--r--compiler/nativeGen/X86/Instr.hs1
-rw-r--r--compiler/parser/HaddockUtils.hs3
-rw-r--r--compiler/rename/RnEnv.lhs2
-rw-r--r--compiler/rename/RnExpr.lhs1
-rw-r--r--compiler/rename/RnHsDoc.hs1
-rw-r--r--compiler/rename/RnSource.lhs1
-rw-r--r--compiler/simplCore/CoreMonad.lhs2
-rw-r--r--compiler/simplCore/SAT.lhs2
-rw-r--r--compiler/simplCore/SetLevels.lhs2
-rw-r--r--compiler/simplStg/SRT.lhs2
-rw-r--r--compiler/specialise/SpecConstr.lhs1
-rw-r--r--compiler/stgSyn/StgLint.lhs2
-rw-r--r--compiler/stranal/WorkWrap.lhs5
-rw-r--r--compiler/stranal/WwLib.lhs2
-rw-r--r--compiler/typecheck/TcBinds.lhs2
-rw-r--r--compiler/typecheck/TcEnv.lhs2
-rw-r--r--compiler/typecheck/TcHsSyn.lhs1
-rw-r--r--compiler/typecheck/TcHsType.lhs3
-rw-r--r--compiler/typecheck/TcPat.lhs2
-rw-r--r--compiler/typecheck/TcRnMonad.lhs1
-rw-r--r--compiler/typecheck/TcRnTypes.lhs2
-rw-r--r--compiler/typecheck/TcSimplify.lhs2
-rw-r--r--compiler/typecheck/TcTyFuns.lhs1
-rw-r--r--compiler/types/FamInstEnv.lhs2
-rw-r--r--compiler/types/Generics.lhs2
-rw-r--r--compiler/utils/Serialized.hs1
-rw-r--r--compiler/vectorise/VectMonad.hs1
-rw-r--r--compiler/vectorise/Vectorise.hs4
88 files changed, 7 insertions, 148 deletions
diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs
index a5bbacc052..b1c90b3c36 100644
--- a/compiler/basicTypes/MkId.lhs
+++ b/compiler/basicTypes/MkId.lhs
@@ -50,7 +50,6 @@ import TysPrim
import TysWiredIn
import PrelRules
import Type
-import TypeRep
import Coercion
import TcType
import CoreUtils ( exprType, mkCoerce )
@@ -60,7 +59,6 @@ import TyCon
import Class
import VarSet
import Name
-import OccName
import PrimOp
import ForeignCall
import DataCon
@@ -70,7 +68,6 @@ import IdInfo
import NewDemand
import CoreSyn
import Unique
-import Maybes
import PrelNames
import BasicTypes hiding ( SuccessFlag(..) )
import Util
diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs
index bf5ef8eb1a..d2126cd05c 100644
--- a/compiler/cmm/CmmBuildInfoTables.hs
+++ b/compiler/cmm/CmmBuildInfoTables.hs
@@ -18,7 +18,6 @@ import BlockId
import Bitmap
import CLabel
import Cmm hiding (blockId)
-import CmmExpr
import CmmInfo
import CmmProcPointZ
import CmmStackLayout
@@ -35,7 +34,6 @@ import MkZipCfgCmm hiding (CmmAGraph, CmmBlock, CmmTopZ, CmmZ, CmmGraph)
import Monad
import Name
import Outputable
-import Panic
import SMRep
import StgCmmClosure
import StgCmmForeign
diff --git a/compiler/cmm/CmmCPS.hs b/compiler/cmm/CmmCPS.hs
index f6a677a8fe..6a1dc40089 100644
--- a/compiler/cmm/CmmCPS.hs
+++ b/compiler/cmm/CmmCPS.hs
@@ -32,8 +32,6 @@ import UniqSet
import Unique
import Monad
-import IO
-import Data.List
-----------------------------------------------------------------------------
-- |Top level driver for the CPS pass
diff --git a/compiler/cmm/CmmCPSGen.hs b/compiler/cmm/CmmCPSGen.hs
index b5f51a98b9..dc43a831e6 100644
--- a/compiler/cmm/CmmCPSGen.hs
+++ b/compiler/cmm/CmmCPSGen.hs
@@ -24,7 +24,6 @@ import Constants
import StaticFlags
import Unique
import Maybe
-import List
import FastString
import Panic
diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs
index 64af09d649..a49fa65ab4 100644
--- a/compiler/cmm/CmmCallConv.hs
+++ b/compiler/cmm/CmmCallConv.hs
@@ -15,7 +15,6 @@ import ZipCfgCmmRep (Convention(..))
import Constants
import StaticFlags (opt_Unregisterised)
import Outputable
-import Panic
-- Calculate the 'GlobalReg' or stack locations for function call
-- parameters as used by the Cmm calling convention.
diff --git a/compiler/cmm/CmmCvt.hs b/compiler/cmm/CmmCvt.hs
index da770636b4..016e725673 100644
--- a/compiler/cmm/CmmCvt.hs
+++ b/compiler/cmm/CmmCvt.hs
@@ -6,7 +6,6 @@ where
import BlockId
import Cmm
-import CmmExpr
import MkZipCfgCmm hiding (CmmGraph)
import ZipCfgCmmRep -- imported for reverse conversion
import CmmZipUtil
@@ -16,11 +15,8 @@ import qualified ZipCfg as G
import FastString
import Monad
import Outputable
-import Panic
import UniqSupply
-import Maybe
-
cmmToZgraph :: GenCmm d h (ListGraph CmmStmt) -> UniqSM (GenCmm d h (CmmStackInfo, CmmGraph))
cmmOfZgraph :: GenCmm d h (CmmStackInfo, CmmGraph) -> GenCmm d h (ListGraph CmmStmt)
diff --git a/compiler/cmm/CmmProcPointZ.hs b/compiler/cmm/CmmProcPointZ.hs
index b477f4c233..138626765b 100644
--- a/compiler/cmm/CmmProcPointZ.hs
+++ b/compiler/cmm/CmmProcPointZ.hs
@@ -11,7 +11,6 @@ import BlockId
import CLabel
import Cmm hiding (blockId)
import CmmContFlowOpt
-import CmmExpr
import CmmInfo
import CmmLiveZ
import CmmTx
@@ -23,7 +22,6 @@ import MkZipCfg
import MkZipCfgCmm hiding (CmmBlock, CmmGraph, CmmTopZ)
import Monad
import Outputable
-import Panic
import UniqSet
import UniqSupply
import ZipCfg
diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs
index fb6931e006..1f88b7679a 100644
--- a/compiler/cmm/CmmSpillReload.hs
+++ b/compiler/cmm/CmmSpillReload.hs
@@ -18,7 +18,6 @@ import CmmTx
import CmmLiveZ
import DFMonad
import MkZipCfg
-import OptimizationFuel
import PprCmm()
import ZipCfg
import ZipCfgCmmRep
@@ -27,7 +26,6 @@ import ZipDataflow
import Monad
import Outputable hiding (empty)
import qualified Outputable as PP
-import Panic
import UniqSet
import Maybe
diff --git a/compiler/cmm/CmmStackLayout.hs b/compiler/cmm/CmmStackLayout.hs
index ab00100bfe..be16f19c06 100644
--- a/compiler/cmm/CmmStackLayout.hs
+++ b/compiler/cmm/CmmStackLayout.hs
@@ -18,7 +18,6 @@ import MkZipCfg
import MkZipCfgCmm hiding (CmmBlock, CmmGraph)
import Monad
import Outputable
-import Panic
import SMRep (ByteOff)
import ZipCfg
import ZipCfg as Z
diff --git a/compiler/cmm/DFMonad.hs b/compiler/cmm/DFMonad.hs
index bc64ed6eae..4c254e68aa 100644
--- a/compiler/cmm/DFMonad.hs
+++ b/compiler/cmm/DFMonad.hs
@@ -16,7 +16,6 @@ import CmmTx
import PprCmm()
import OptimizationFuel
-import Control.Monad
import Maybes
import Outputable
import UniqSupply
diff --git a/compiler/cmm/PprCmmZ.hs b/compiler/cmm/PprCmmZ.hs
index e9199ffd82..4d8cc5168e 100644
--- a/compiler/cmm/PprCmmZ.hs
+++ b/compiler/cmm/PprCmmZ.hs
@@ -6,7 +6,6 @@ where
import BlockId
import Cmm
-import CmmExpr
import PprCmm
import Outputable
import qualified ZipCfgCmmRep as G
diff --git a/compiler/cmm/ZipDataflow.hs b/compiler/cmm/ZipDataflow.hs
index 17212bb3af..92fc375181 100644
--- a/compiler/cmm/ZipDataflow.hs
+++ b/compiler/cmm/ZipDataflow.hs
@@ -29,10 +29,8 @@ import qualified ZipCfg as G
import Maybes
import Outputable
-import Panic
import Control.Monad
-import Maybe
{-
diff --git a/compiler/codeGen/CgCon.lhs b/compiler/codeGen/CgCon.lhs
index 532965c084..8259584c41 100644
--- a/compiler/codeGen/CgCon.lhs
+++ b/compiler/codeGen/CgCon.lhs
@@ -48,8 +48,6 @@ import ListSetOps
import Util
import FastString
import StaticFlags
-
-import Control.Monad
\end{code}
diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs
index 5b989f8fe2..f704a69c18 100644
--- a/compiler/codeGen/CgInfoTbls.hs
+++ b/compiler/codeGen/CgInfoTbls.hs
@@ -39,7 +39,6 @@ import DataCon
import Unique
import StaticFlags
-import Maybes
import Constants
import Util
import Outputable
diff --git a/compiler/codeGen/CgLetNoEscape.lhs b/compiler/codeGen/CgLetNoEscape.lhs
index 14f5fb8269..5870cece99 100644
--- a/compiler/codeGen/CgLetNoEscape.lhs
+++ b/compiler/codeGen/CgLetNoEscape.lhs
@@ -30,7 +30,6 @@ import CLabel
import ClosureInfo
import CostCentre
import Id
-import Var
import SMRep
import BasicTypes
\end{code}
diff --git a/compiler/codeGen/CgProf.hs b/compiler/codeGen/CgProf.hs
index 24efe3a009..7750c0f08e 100644
--- a/compiler/codeGen/CgProf.hs
+++ b/compiler/codeGen/CgProf.hs
@@ -50,7 +50,6 @@ import FastString
import Constants -- Lots of field offsets
import Outputable
-import Data.Maybe
import Data.Char
import Control.Monad
diff --git a/compiler/codeGen/CodeGen.lhs b/compiler/codeGen/CodeGen.lhs
index a7ecf84df9..106fcc1cf1 100644
--- a/compiler/codeGen/CodeGen.lhs
+++ b/compiler/codeGen/CodeGen.lhs
@@ -41,7 +41,6 @@ import HscTypes
import CostCentre
import Id
import Name
-import OccName
import TyCon
import Module
import ErrUtils
diff --git a/compiler/codeGen/StgCmm.hs b/compiler/codeGen/StgCmm.hs
index ee1983c34b..84edcce21c 100644
--- a/compiler/codeGen/StgCmm.hs
+++ b/compiler/codeGen/StgCmm.hs
@@ -41,7 +41,6 @@ import IdInfo
import Type
import DataCon
import Name
-import OccName
import TyCon
import Module
import ErrUtils
diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs
index dbeab2b337..64d3ef1794 100644
--- a/compiler/codeGen/StgCmmBind.hs
+++ b/compiler/codeGen/StgCmmBind.hs
@@ -47,8 +47,6 @@ import Outputable
import FastString
import Maybes
-import Data.List
-
------------------------------------------------------------------------
-- Top-level bindings
------------------------------------------------------------------------
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index d4789be8e7..d66dda5021 100644
--- a/compiler/codeGen/StgCmmClosure.hs
+++ b/compiler/codeGen/StgCmmClosure.hs
@@ -82,7 +82,6 @@ import Id
import IdInfo
import DataCon
import Name
-import OccName
import Type
import TypeRep
import TcType
diff --git a/compiler/codeGen/StgCmmEnv.hs b/compiler/codeGen/StgCmmEnv.hs
index 67d82f08cd..a1ba606584 100644
--- a/compiler/codeGen/StgCmmEnv.hs
+++ b/compiler/codeGen/StgCmmEnv.hs
@@ -41,7 +41,6 @@ import FastString
import PprCmm ( {- instance Outputable -} )
import Id
import VarEnv
-import Maybes
import Monad
import Name
import StgSyn
diff --git a/compiler/codeGen/StgCmmHeap.hs b/compiler/codeGen/StgCmmHeap.hs
index 817a896591..a02d2e24a3 100644
--- a/compiler/codeGen/StgCmmHeap.hs
+++ b/compiler/codeGen/StgCmmHeap.hs
@@ -42,7 +42,6 @@ import CostCentre
import Outputable
import FastString( LitString, mkFastString, sLit )
import Constants
-import Data.List
-----------------------------------------------------------
diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs
index 9e7263c091..84d4ef0362 100644
--- a/compiler/codeGen/StgCmmLayout.hs
+++ b/compiler/codeGen/StgCmmLayout.hs
@@ -59,7 +59,6 @@ import StaticFlags
import Bitmap
import Data.Bits
-import Maybes
import Constants
import Util
import Data.List
diff --git a/compiler/codeGen/StgCmmProf.hs b/compiler/codeGen/StgCmmProf.hs
index bae8694cff..6fb20f8f46 100644
--- a/compiler/codeGen/StgCmmProf.hs
+++ b/compiler/codeGen/StgCmmProf.hs
@@ -52,7 +52,6 @@ import FastString
import Constants -- Lots of field offsets
import Outputable
-import Data.Maybe
import Data.Char
import Control.Monad
diff --git a/compiler/codeGen/StgCmmUtils.hs b/compiler/codeGen/StgCmmUtils.hs
index eb437a9c3d..357ca2c5b6 100644
--- a/compiler/codeGen/StgCmmUtils.hs
+++ b/compiler/codeGen/StgCmmUtils.hs
@@ -50,7 +50,6 @@ import StgCmmMonad
import StgCmmClosure
import BlockId
import Cmm
-import CmmExpr
import MkZipCfgCmm
import CLabel
import CmmUtils
diff --git a/compiler/coreSyn/CoreArity.lhs b/compiler/coreSyn/CoreArity.lhs
index d57c895d15..28732b3198 100644
--- a/compiler/coreSyn/CoreArity.lhs
+++ b/compiler/coreSyn/CoreArity.lhs
@@ -34,9 +34,6 @@ import Outputable
import DynFlags
import StaticFlags ( opt_NoStateHack )
import FastString
-import Maybes
-
-import GHC.Exts -- For `xori`
\end{code}
%************************************************************************
diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs
index 11e45b154d..ff68b129f0 100644
--- a/compiler/coreSyn/CoreTidy.lhs
+++ b/compiler/coreSyn/CoreTidy.lhs
@@ -22,7 +22,6 @@ import Var
import VarEnv
import UniqFM
import Name hiding (tidyNameOcc)
-import OccName
import SrcLoc
import Maybes
diff --git a/compiler/coreSyn/MkCore.lhs b/compiler/coreSyn/MkCore.lhs
index c7e88be9e5..f67c78ad05 100644
--- a/compiler/coreSyn/MkCore.lhs
+++ b/compiler/coreSyn/MkCore.lhs
@@ -50,7 +50,6 @@ import TysWiredIn
import PrelNames
import Type
-import TypeRep
import TysPrim ( alphaTyVar )
import DataCon ( DataCon, dataConWorkId )
diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs
index 4d85e9016e..8260cfb473 100644
--- a/compiler/deSugar/Coverage.lhs
+++ b/compiler/deSugar/Coverage.lhs
@@ -27,7 +27,6 @@ import FiniteMap
import Data.Array
import Data.Maybe
-import System.IO (FilePath)
import System.Directory ( createDirectoryIfMissing )
import Trace.Hpc.Mix
diff --git a/compiler/deSugar/DsBinds.lhs b/compiler/deSugar/DsBinds.lhs
index e65da3cf9b..0c8e37a0bb 100644
--- a/compiler/deSugar/DsBinds.lhs
+++ b/compiler/deSugar/DsBinds.lhs
@@ -41,7 +41,6 @@ import Var ( Var, TyVar )
import VarSet
import Rules
import VarEnv
-import Type
import Outputable
import SrcLoc
import Maybes
diff --git a/compiler/deSugar/DsCCall.lhs b/compiler/deSugar/DsCCall.lhs
index 2034e3733e..27dff94839 100644
--- a/compiler/deSugar/DsCCall.lhs
+++ b/compiler/deSugar/DsCCall.lhs
@@ -24,7 +24,6 @@ import DsMonad
import CoreUtils
import MkCore
import Var
-import Id
import MkId
import Maybes
import ForeignCall
diff --git a/compiler/deSugar/DsExpr.lhs b/compiler/deSugar/DsExpr.lhs
index ef28c55d35..2eca842eb0 100644
--- a/compiler/deSugar/DsExpr.lhs
+++ b/compiler/deSugar/DsExpr.lhs
@@ -29,7 +29,6 @@ import Name
import NameEnv
#ifdef GHCI
-import PrelNames
-- Template Haskell stuff iff bootstrapped
import DsMeta
#endif
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 87afbbe6a3..ab40ab1e2b 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -25,7 +25,6 @@ module DsMeta( dsBracket,
import {-# SOURCE #-} DsExpr ( dsExpr )
import MatchLit
-import DsUtils
import DsMonad
import qualified Language.Haskell.TH as TH
diff --git a/compiler/deSugar/DsMonad.lhs b/compiler/deSugar/DsMonad.lhs
index 83a5d212ae..58a154a93c 100644
--- a/compiler/deSugar/DsMonad.lhs
+++ b/compiler/deSugar/DsMonad.lhs
@@ -53,10 +53,8 @@ import Type
import UniqSupply
import Name
import NameEnv
-import OccName
import DynFlags
import ErrUtils
-import MonadUtils
import FastString
import Data.IORef
diff --git a/compiler/deSugar/MatchCon.lhs b/compiler/deSugar/MatchCon.lhs
index 2912e29a6f..9ec7f35706 100644
--- a/compiler/deSugar/MatchCon.lhs
+++ b/compiler/deSugar/MatchCon.lhs
@@ -23,7 +23,6 @@ import HsSyn
import DsBinds
import DataCon
import TcType
-import Type
import CoreSyn
import MkCore
import DsMonad
diff --git a/compiler/deSugar/MatchLit.lhs b/compiler/deSugar/MatchLit.lhs
index 2da52c78b0..9d3ff49f62 100644
--- a/compiler/deSugar/MatchLit.lhs
+++ b/compiler/deSugar/MatchLit.lhs
@@ -27,10 +27,8 @@ import TyCon
import DataCon
import TcHsSyn ( shortCutLit )
import TcType
-import Type
import PrelNames
import TysWiredIn
-import Unique
import Literal
import SrcLoc
import Ratio
diff --git a/compiler/ghci/ByteCodeAsm.lhs b/compiler/ghci/ByteCodeAsm.lhs
index 4d360e1ffe..b1ef67e17e 100644
--- a/compiler/ghci/ByteCodeAsm.lhs
+++ b/compiler/ghci/ByteCodeAsm.lhs
@@ -30,7 +30,6 @@ import PrimOp
import Constants
import FastString
import SMRep
-import FiniteMap
import Outputable
import Control.Monad ( foldM )
@@ -41,18 +40,9 @@ import Data.Array.Unboxed ( listArray )
import Data.Array.Base ( UArray(..) )
import Data.Array.ST ( castSTUArray )
import Foreign
-import Data.Bits
-import Data.Int ( Int64 )
import Data.Char ( ord )
import GHC.Base ( ByteArray#, MutableByteArray#, RealWorld )
-import GHC.Ptr ( Ptr(..) )
-
-#if __GLASGOW_HASKELL__ >= 611
-import GHC.IO ( IO(..) )
-#else
-import GHC.IOBase ( IO(..) )
-#endif
-- -----------------------------------------------------------------------------
-- Unlinked BCOs
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index 8ca0bfc289..21a206490e 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -50,12 +50,10 @@ import ListSetOps
import DynFlags
import BasicTypes
import Outputable
-import PackageConfig
import Panic
import Util
import StaticFlags
import ErrUtils
-import DriverPhases
import SrcLoc
import qualified Maybes
import UniqSet
diff --git a/compiler/hsSyn/HsLit.lhs b/compiler/hsSyn/HsLit.lhs
index bd125106e2..9a0e8750e6 100644
--- a/compiler/hsSyn/HsLit.lhs
+++ b/compiler/hsSyn/HsLit.lhs
@@ -14,7 +14,6 @@ import HsTypes (PostTcType)
import Type ( Type )
import Outputable
import FastString
-import Ratio ( Rational )
\end{code}
diff --git a/compiler/iface/BinIface.hs b/compiler/iface/BinIface.hs
index 72a62a66de..679494b0a5 100644
--- a/compiler/iface/BinIface.hs
+++ b/compiler/iface/BinIface.hs
@@ -22,9 +22,7 @@ import Annotations
import IfaceSyn
import Module
import Name
-import OccName
import VarEnv
-import InstEnv
import Class
import DynFlags
import UniqFM
diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs
index 9213afd4ce..ba383d8d1d 100644
--- a/compiler/iface/BuildTyCl.lhs
+++ b/compiler/iface/BuildTyCl.lhs
@@ -20,7 +20,6 @@ import Var
import VarSet
import BasicTypes
import Name
-import OccName
import MkId
import Class
import TyCon
@@ -30,8 +29,6 @@ import Coercion
import TcRnMonad
import Util ( count )
import Outputable
-
-import Data.List
\end{code}
diff --git a/compiler/iface/IfaceEnv.lhs b/compiler/iface/IfaceEnv.lhs
index ab1f9057e2..05c6289950 100644
--- a/compiler/iface/IfaceEnv.lhs
+++ b/compiler/iface/IfaceEnv.lhs
@@ -26,7 +26,6 @@ import TyCon
import DataCon
import Var
import Name
-import OccName
import PrelNames
import Module
import LazyUniqFM
diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs
index e468fe905b..1412b0005b 100644
--- a/compiler/iface/LoadIface.lhs
+++ b/compiler/iface/LoadIface.lhs
@@ -28,7 +28,6 @@ import HscTypes
import BasicTypes hiding (SuccessFlag(..))
import TcRnMonad
-import Type
import PrelNames
import PrelInfo
@@ -39,9 +38,7 @@ import InstEnv
import FamInstEnv
import Name
import NameEnv
-import MkId
import Module
-import OccName
import Maybes
import ErrUtils
import Finder
@@ -55,8 +52,6 @@ import FastString
import Fingerprint
import Control.Monad
-import Data.List
-import Data.Maybe
\end{code}
diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 478d7d3e0b..c929d96509 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -51,7 +51,6 @@ Basic idea:
#include "HsVersions.h"
import IfaceSyn
-import IfaceType
import LoadIface
import Id
import IdInfo
@@ -77,7 +76,6 @@ import Name
import RdrName
import NameEnv
import NameSet
-import OccName
import Module
import BinIface
import ErrUtils
@@ -95,7 +93,6 @@ import ListSetOps
import Binary
import Fingerprint
import Bag
-import Panic
import Control.Monad
import Data.List
diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs
index 61475dee6c..7db955162f 100644
--- a/compiler/iface/TcIface.lhs
+++ b/compiler/iface/TcIface.lhs
@@ -42,7 +42,6 @@ import qualified Var
import VarEnv
import Name
import NameEnv
-import OccName
import Module
import LazyUniqFM
import UniqSupply
@@ -57,7 +56,6 @@ import BasicTypes (Arity)
import Control.Monad
import Data.List
-import Data.Maybe
\end{code}
This module takes
diff --git a/compiler/main/CodeOutput.lhs b/compiler/main/CodeOutput.lhs
index 3b45a38d6a..3c82ea7508 100644
--- a/compiler/main/CodeOutput.lhs
+++ b/compiler/main/CodeOutput.lhs
@@ -33,7 +33,6 @@ import Outputable
import Module
import Maybes ( firstJust )
-import Distribution.Text
import Directory ( doesFileExist )
import Monad ( when )
import IO
diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs
index ac0eff8e2b..cc19e317cd 100644
--- a/compiler/main/Finder.lhs
+++ b/compiler/main/Finder.lhs
@@ -40,10 +40,8 @@ import Maybes ( expectJust )
import Distribution.Package hiding (PackageId)
import Data.IORef ( IORef, writeIORef, readIORef, modifyIORef )
-import Data.List
import System.Directory
import System.FilePath
-import System.IO
import Control.Monad
import System.Time ( ClockTime )
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 8cf16666e5..b00f79f150 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -245,7 +245,6 @@ import qualified Linker
import Linker ( HValue )
import ByteCodeInstr
import BreakArray
-import NameSet
import InteractiveEval
import TcRnDriver
#endif
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index f23ff5831e..05c17abeb9 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -117,8 +117,6 @@ import RdrName
import Name
import NameEnv
import NameSet
-import OccName ( OccName, OccEnv, lookupOccEnv, mkOccEnv, emptyOccEnv,
- extendOccEnv )
import Module
import InstEnv ( InstEnv, Instance )
import FamInstEnv ( FamInstEnv, FamInst )
@@ -139,7 +137,7 @@ import Packages hiding ( Version(..) )
import DynFlags ( DynFlags(..), isOneShot, HscTarget (..), dopt,
DynFlag(..) )
import DriverPhases ( HscSource(..), isHsBoot, hscSourceString, Phase )
-import BasicTypes ( IPName, Fixity, defaultFixity, WarningTxt(..) )
+import BasicTypes ( IPName, defaultFixity, WarningTxt(..) )
import OptimizationFuel ( OptFuelState )
import IfaceSyn
import FiniteMap ( FiniteMap )
diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs
index 2479028921..d87ffa1bf5 100644
--- a/compiler/main/PprTyThing.hs
+++ b/compiler/main/PprTyThing.hs
@@ -20,7 +20,6 @@ import qualified GHC
import GHC ( TyThing(..) )
import TyCon
-import Type ( TyThing(..), tidyTopType, pprTypeApp )
import TcType
import Var
import Name
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 26c85bdc2c..bb706df440 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -55,7 +55,6 @@ import System.IO
import System.IO.Error as IO
import System.Directory
import Data.Char
-import Data.Maybe
import Data.List
#ifndef mingw32_HOST_OS
diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs
index 5c78927c7d..530e54ccac 100644
--- a/compiler/main/TidyPgm.lhs
+++ b/compiler/main/TidyPgm.lhs
@@ -33,7 +33,6 @@ import Name
import NameSet
import IfaceEnv
import NameEnv
-import OccName
import TcType
import DataCon
import TyCon
@@ -46,7 +45,6 @@ import Outputable
import FastBool hiding ( fastOr )
import Data.List ( partition )
-import Data.Maybe ( isJust )
import Data.IORef ( IORef, readIORef, writeIORef )
\end{code}
diff --git a/compiler/nativeGen/Reg.hs b/compiler/nativeGen/Reg.hs
index 4819d0f3c7..1da72c4cef 100644
--- a/compiler/nativeGen/Reg.hs
+++ b/compiler/nativeGen/Reg.hs
@@ -29,7 +29,6 @@ where
import Outputable
import Unique
-import Panic
import RegClass
import Data.List
diff --git a/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs b/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
index 8521e92601..74eb0c2f55 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
@@ -18,7 +18,6 @@ import UniqFM
import UniqSet
import UniqSupply
-import Control.Monad
import Data.List
-- | Do register coalescing on this top level thing
diff --git a/compiler/nativeGen/RegAlloc/Graph/Main.hs b/compiler/nativeGen/RegAlloc/Graph/Main.hs
index 4ffcfee355..5fa771cfb8 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Main.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Main.hs
@@ -11,7 +11,6 @@ module RegAlloc.Graph.Main (
where
import qualified GraphColor as Color
-import qualified GraphBase as Color
import RegAlloc.Liveness
import RegAlloc.Graph.Spill
import RegAlloc.Graph.SpillClean
diff --git a/compiler/nativeGen/RegAlloc/Graph/Spill.hs b/compiler/nativeGen/RegAlloc/Graph/Spill.hs
index ce34b513a1..f9a2586f5a 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Spill.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Spill.hs
@@ -22,7 +22,6 @@ import UniqSupply
import Outputable
import Data.List
-import Data.Maybe
-- | Spill all these virtual regs to memory
diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs b/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
index 9d0dcf9236..b7b7475aec 100644
--- a/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
@@ -42,7 +42,6 @@ import State
import Outputable
import Util
-import Data.Maybe
import Data.List ( find, nub )
--
diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
index ff3f76a545..9de48d5cd8 100644
--- a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
@@ -33,7 +33,6 @@ import State
import Data.List (nub, minimumBy)
import Data.Maybe
-import Control.Monad
type SpillCostRecord
= ( VirtualReg -- register name
diff --git a/compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs b/compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
index db3d8a354f..4ba637f9b7 100644
--- a/compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
+++ b/compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
@@ -10,7 +10,6 @@ import Panic
import Data.Word
import Data.Bits
-import Data.List
type FreeRegs
= Word32
diff --git a/compiler/nativeGen/SPARC/Instr.hs b/compiler/nativeGen/SPARC/Instr.hs
index 5cb28d5c40..87b6abc317 100644
--- a/compiler/nativeGen/SPARC/Instr.hs
+++ b/compiler/nativeGen/SPARC/Instr.hs
@@ -43,8 +43,6 @@ import FastString
import FastBool
import Outputable
-import GHC.Exts
-
-- | Register or immediate
data RI
diff --git a/compiler/nativeGen/X86/Instr.hs b/compiler/nativeGen/X86/Instr.hs
index 7e11d23363..5d731bd88d 100644
--- a/compiler/nativeGen/X86/Instr.hs
+++ b/compiler/nativeGen/X86/Instr.hs
@@ -28,7 +28,6 @@ import Outputable
import Constants (rESERVED_C_STACK_BYTES)
import CLabel
-import Panic
-- Size of a PPC memory address, in bytes.
--
diff --git a/compiler/parser/HaddockUtils.hs b/compiler/parser/HaddockUtils.hs
index ea73911c99..b84692a6b1 100644
--- a/compiler/parser/HaddockUtils.hs
+++ b/compiler/parser/HaddockUtils.hs
@@ -2,16 +2,13 @@
module HaddockUtils where
import HsSyn
-import HsDoc
import {-# SOURCE #-} HaddockLex
import HaddockParse
import SrcLoc
import RdrName
import Control.Monad
-import Data.Maybe
import Data.Char
-import Data.Either
-- -----------------------------------------------------------------------------
-- Parsing module headers
diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs
index 2ecaf61295..955786b323 100644
--- a/compiler/rename/RnEnv.lhs
+++ b/compiler/rename/RnEnv.lhs
@@ -57,7 +57,7 @@ import Module ( Module, ModuleName )
import PrelNames ( mkUnboundName, rOOT_MAIN, iNTERACTIVE,
consDataConKey, hasKey, forall_tv_RDR )
import UniqSupply
-import BasicTypes ( IPName, mapIPName, Fixity )
+import BasicTypes
import ErrUtils ( Message )
import SrcLoc
import Outputable
diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs
index c459b70c5b..86b41ae275 100644
--- a/compiler/rename/RnExpr.lhs
+++ b/compiler/rename/RnExpr.lhs
@@ -50,7 +50,6 @@ import SrcLoc
import FastString
import List ( unzip4 )
-import Control.Monad
\end{code}
diff --git a/compiler/rename/RnHsDoc.hs b/compiler/rename/RnHsDoc.hs
index c556d2c3da..4d10edca5e 100644
--- a/compiler/rename/RnHsDoc.hs
+++ b/compiler/rename/RnHsDoc.hs
@@ -2,7 +2,6 @@
module RnHsDoc ( rnHaddock, rnHsDoc, rnLHsDoc, rnMbLHsDoc ) where
import TcRnTypes
-import TcRnMonad ( RnM )
import RnEnv ( dataTcOccs, lookupGreRn_maybe )
import HsSyn
diff --git a/compiler/rename/RnSource.lhs b/compiler/rename/RnSource.lhs
index 052b7e03d6..674ec78203 100644
--- a/compiler/rename/RnSource.lhs
+++ b/compiler/rename/RnSource.lhs
@@ -46,7 +46,6 @@ import Maybe ( isNothing )
import BasicTypes ( Boxity(..) )
import ListSetOps (findDupsEq)
-import List
import Control.Monad
\end{code}
diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs
index ae45ba4079..a231103ec8 100644
--- a/compiler/simplCore/CoreMonad.lhs
+++ b/compiler/simplCore/CoreMonad.lhs
@@ -55,7 +55,6 @@ import TcRnMonad ( TcM, initTc )
import Outputable
import qualified ErrUtils as Err
-import MonadUtils
import Maybes
import UniqSupply
@@ -63,7 +62,6 @@ import Data.Dynamic
import Data.IORef
import Data.Word
import Control.Monad
-import Control.Applicative
import Prelude hiding ( read )
diff --git a/compiler/simplCore/SAT.lhs b/compiler/simplCore/SAT.lhs
index ca251568a7..08bb1ecf40 100644
--- a/compiler/simplCore/SAT.lhs
+++ b/compiler/simplCore/SAT.lhs
@@ -56,10 +56,8 @@ import Var
import CoreSyn
import CoreUtils
import Type
-import TcType
import Id
import Name
-import OccName
import VarEnv
import UniqSupply
import Util
diff --git a/compiler/simplCore/SetLevels.lhs b/compiler/simplCore/SetLevels.lhs
index 9726aa68a0..0797ad7727 100644
--- a/compiler/simplCore/SetLevels.lhs
+++ b/compiler/simplCore/SetLevels.lhs
@@ -60,7 +60,7 @@ import CoreUtils ( exprType, exprIsTrivial, mkPiTypes )
import CoreFVs -- all of it
import CoreSubst ( Subst, emptySubst, extendInScope, extendIdSubst,
cloneIdBndr, cloneRecIdBndrs )
-import Id ( Id, idType, mkSysLocal, isOneShotLambda,
+import Id ( idType, mkSysLocal, isOneShotLambda,
zapDemandIdInfo, transferPolyIdInfo,
idSpecialisation, idWorkerInfo, setIdInfo
)
diff --git a/compiler/simplStg/SRT.lhs b/compiler/simplStg/SRT.lhs
index 989fa4c1f8..abad3ce48d 100644
--- a/compiler/simplStg/SRT.lhs
+++ b/compiler/simplStg/SRT.lhs
@@ -27,8 +27,6 @@ import Bitmap
import Outputable
-import List
-
import Util
\end{code}
diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs
index 3a4b382910..5357a53539 100644
--- a/compiler/specialise/SpecConstr.lhs
+++ b/compiler/specialise/SpecConstr.lhs
@@ -32,7 +32,6 @@ import Var
import VarEnv
import VarSet
import Name
-import OccName ( mkSpecOcc )
import DynFlags ( DynFlags(..) )
import StaticFlags ( opt_PprStyle_Debug )
import StaticFlags ( opt_SpecInlineJoinPoints )
diff --git a/compiler/stgSyn/StgLint.lhs b/compiler/stgSyn/StgLint.lhs
index f2cecf9b01..21db424b43 100644
--- a/compiler/stgSyn/StgLint.lhs
+++ b/compiler/stgSyn/StgLint.lhs
@@ -20,7 +20,7 @@ import Name ( getSrcLoc )
import ErrUtils ( Message, mkLocMessage )
import TypeRep
import Type ( mkFunTys, splitFunTys, splitTyConApp_maybe,
- isUnLiftedType, isTyVarTy, dropForAlls, Type
+ isUnLiftedType, isTyVarTy, dropForAlls
)
import TyCon ( isAlgTyCon, isNewTyCon, tyConDataCons )
import Util ( zipEqual, equalLength )
diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs
index a3219abb20..7b124f303f 100644
--- a/compiler/stranal/WorkWrap.lhs
+++ b/compiler/stranal/WorkWrap.lhs
@@ -11,10 +11,7 @@ import CoreUnfold ( certainlyWillInline )
import CoreUtils ( exprType, exprIsHNF, mkInlineMe )
import CoreArity ( exprArity )
import Var
-import Id ( Id, idType, isOneShotLambda, idUnfolding,
- setIdNewStrictness, mkWorkerId,
- setIdWorkerInfo, setInlineActivation,
- setIdArity, idInfo )
+import Id
import Type ( Type )
import IdInfo
import NewDemand ( Demand(..), StrictSig(..), DmdType(..), DmdResult(..),
diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs
index a7050dc0d0..bceb453487 100644
--- a/compiler/stranal/WwLib.lhs
+++ b/compiler/stranal/WwLib.lhs
@@ -23,7 +23,7 @@ import TysWiredIn ( tupleCon )
import Type
import Coercion ( mkSymCoercion, splitNewTypeRepCo_maybe )
import BasicTypes ( Boxity(..) )
-import Var ( Var, isId )
+import Var ( Var )
import UniqSupply
import Unique
import Util ( zipWithEqual )
diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs
index eae66a89e0..9bf8fafbaa 100644
--- a/compiler/typecheck/TcBinds.lhs
+++ b/compiler/typecheck/TcBinds.lhs
@@ -26,7 +26,6 @@ import TcHsType
import TcPat
import TcMType
import TcType
-import {- Kind parts of -} Type
import Coercion
import VarEnv
import TysPrim
@@ -41,7 +40,6 @@ import Bag
import ErrUtils
import Digraph
import Maybes
-import List
import Util
import BasicTypes
import Outputable
diff --git a/compiler/typecheck/TcEnv.lhs b/compiler/typecheck/TcEnv.lhs
index 14f9541f29..2146932b24 100644
--- a/compiler/typecheck/TcEnv.lhs
+++ b/compiler/typecheck/TcEnv.lhs
@@ -70,11 +70,9 @@ import TypeRep
import Class
import Name
import NameEnv
-import OccName
import HscTypes
import SrcLoc
import Outputable
-import Maybes
import Unique
import FastString
\end{code}
diff --git a/compiler/typecheck/TcHsSyn.lhs b/compiler/typecheck/TcHsSyn.lhs
index 6120621095..7b88356cf2 100644
--- a/compiler/typecheck/TcHsSyn.lhs
+++ b/compiler/typecheck/TcHsSyn.lhs
@@ -48,7 +48,6 @@ import VarEnv
import Literal
import BasicTypes
import Maybes
-import Unique
import SrcLoc
import Util
import Bag
diff --git a/compiler/typecheck/TcHsType.lhs b/compiler/typecheck/TcHsType.lhs
index a63c2cee90..d64461ffd5 100644
--- a/compiler/typecheck/TcHsType.lhs
+++ b/compiler/typecheck/TcHsType.lhs
@@ -43,7 +43,6 @@ import Coercion
import TyCon
import Class
import Name
-import OccName
import NameSet
import PrelNames
import TysWiredIn
@@ -52,8 +51,6 @@ import SrcLoc
import UniqSupply
import Outputable
import FastString
-
-import Control.Monad
\end{code}
diff --git a/compiler/typecheck/TcPat.lhs b/compiler/typecheck/TcPat.lhs
index 376385aaa6..3423196ad8 100644
--- a/compiler/typecheck/TcPat.lhs
+++ b/compiler/typecheck/TcPat.lhs
@@ -30,7 +30,6 @@ import VarSet
import TcUnify
import TcHsType
import TysWiredIn
-import Type
import Coercion
import StaticFlags
import TyCon
@@ -41,7 +40,6 @@ import DynFlags ( DynFlag( Opt_GADTs ) )
import SrcLoc
import ErrUtils
import Util
-import Maybes
import Outputable
import FastString
import Monad
diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs
index dbe822a222..2450d7b839 100644
--- a/compiler/typecheck/TcRnMonad.lhs
+++ b/compiler/typecheck/TcRnMonad.lhs
@@ -31,7 +31,6 @@ import ErrUtils
import SrcLoc
import NameEnv
import NameSet
-import OccName
import Bag
import Outputable
import UniqSupply
diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs
index c8d75509a3..daed79dbd4 100644
--- a/compiler/typecheck/TcRnTypes.lhs
+++ b/compiler/typecheck/TcRnTypes.lhs
@@ -68,8 +68,6 @@ import Outputable
import ListSetOps
import FastString
-import Data.Maybe
-import Data.List
import Data.Set (Set)
\end{code}
diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs
index 11e202be9b..74952e4c5e 100644
--- a/compiler/typecheck/TcSimplify.lhs
+++ b/compiler/typecheck/TcSimplify.lhs
@@ -45,7 +45,6 @@ import Class
import FunDeps
import PrelInfo
import PrelNames
-import Type
import TysWiredIn
import ErrUtils
import BasicTypes
@@ -54,7 +53,6 @@ import VarEnv
import FiniteMap
import Bag
import Outputable
-import Maybes
import ListSetOps
import Util
import SrcLoc
diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs
index 6426c924ca..bf0b16a79a 100644
--- a/compiler/typecheck/TcTyFuns.lhs
+++ b/compiler/typecheck/TcTyFuns.lhs
@@ -38,7 +38,6 @@ import Bag
import Outputable
import SrcLoc ( Located(..) )
import Maybes
-import MonadUtils
import FastString
-- standard
diff --git a/compiler/types/FamInstEnv.lhs b/compiler/types/FamInstEnv.lhs
index 5ea2096ae1..de5c5a0a9e 100644
--- a/compiler/types/FamInstEnv.lhs
+++ b/compiler/types/FamInstEnv.lhs
@@ -36,8 +36,6 @@ import Outputable
import Maybes
import Util
import FastString
-
-import Maybe
\end{code}
diff --git a/compiler/types/Generics.lhs b/compiler/types/Generics.lhs
index 01632d3596..fed023ed52 100644
--- a/compiler/types/Generics.lhs
+++ b/compiler/types/Generics.lhs
@@ -18,13 +18,11 @@ module Generics ( canDoGenerics, mkTyConGenericBinds,
import HsSyn
import Type
-import TcHsSyn
import TcType
import DataCon
import TyCon
import Name
-import OccName
import RdrName
import BasicTypes
import Var
diff --git a/compiler/utils/Serialized.hs b/compiler/utils/Serialized.hs
index 06b92e4aa1..915ca225a6 100644
--- a/compiler/utils/Serialized.hs
+++ b/compiler/utils/Serialized.hs
@@ -29,7 +29,6 @@ import Data.Data
#else
import Data.Generics
#endif
-import Data.Typeable
-- | Represents a serialized value of a particular type. Attempts can be made to deserialize it at certain types
diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs
index 8fdfcdb999..d0b05ac298 100644
--- a/compiler/vectorise/VectMonad.hs
+++ b/compiler/vectorise/VectMonad.hs
@@ -51,7 +51,6 @@ import VarEnv
import Id
import Name
import NameEnv
-import IOEnv ( liftIO )
import DsMonad
diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs
index 777c195a2a..a0e3e1a068 100644
--- a/compiler/vectorise/Vectorise.hs
+++ b/compiler/vectorise/Vectorise.hs
@@ -13,7 +13,7 @@ import Module ( PackageId )
import CoreSyn
import CoreUtils
import CoreFVs
-import CoreMonad ( CoreM, getHscEnv, liftIO )
+import CoreMonad ( CoreM, getHscEnv )
import DataCon
import TyCon
import Type
@@ -24,8 +24,6 @@ import VarSet
import Id
import OccName
-import DsMonad
-
import Literal ( Literal, mkMachInt )
import TysWiredIn