summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/codeGen/CgClosure.lhs1
-rw-r--r--compiler/codeGen/CgInfoTbls.hs8
-rw-r--r--compiler/coreSyn/MkExternalCore.lhs4
-rw-r--r--compiler/deSugar/Check.lhs1
-rw-r--r--compiler/deSugar/DsGRHSs.lhs2
-rw-r--r--compiler/deSugar/DsListComp.lhs1
-rw-r--r--compiler/deSugar/DsMonad.lhs2
-rw-r--r--compiler/deSugar/Match.lhs1
-rw-r--r--compiler/deSugar/MatchLit.lhs2
-rw-r--r--compiler/hsSyn/HsBinds.lhs2
-rw-r--r--compiler/iface/BuildTyCl.lhs1
-rw-r--r--compiler/iface/LoadIface.lhs2
-rw-r--r--compiler/main/DriverPipeline.hs2
-rw-r--r--compiler/main/ErrUtils.lhs4
-rw-r--r--compiler/main/HeaderInfo.hs1
-rw-r--r--compiler/main/SysTools.lhs1
-rw-r--r--compiler/nativeGen/AsmCodeGen.lhs4
-rw-r--r--compiler/ndpFlatten/Flattening.hs9
-rw-r--r--compiler/parser/HaddockLex.x3
-rw-r--r--compiler/parser/LexCore.hs1
-rw-r--r--compiler/parser/RdrHsSyn.lhs1
-rw-r--r--compiler/profiling/SCCfinal.lhs1
-rw-r--r--compiler/simplCore/LiberateCase.lhs1
-rw-r--r--compiler/simplStg/SRT.lhs5
-rw-r--r--compiler/stgSyn/CoreToStg.lhs1
-rw-r--r--compiler/typecheck/TcEnv.lhs1
-rw-r--r--compiler/typecheck/TcForeign.lhs2
-rw-r--r--compiler/typecheck/TcGadt.lhs1
-rw-r--r--compiler/typecheck/TcHsSyn.lhs2
-rw-r--r--compiler/typecheck/TcRnDriver.lhs2
-rw-r--r--compiler/utils/BufWrite.hs2
-rw-r--r--compiler/utils/Panic.lhs2
32 files changed, 10 insertions, 63 deletions
diff --git a/compiler/codeGen/CgClosure.lhs b/compiler/codeGen/CgClosure.lhs
index 8337f916fe..fd851157d7 100644
--- a/compiler/codeGen/CgClosure.lhs
+++ b/compiler/codeGen/CgClosure.lhs
@@ -36,7 +36,6 @@ import Cmm
import CmmUtils
import CLabel
import StgSyn
-import StaticFlags
import CostCentre
import Id
import Name
diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs
index 4ba406117b..e2e07f94ca 100644
--- a/compiler/codeGen/CgInfoTbls.hs
+++ b/compiler/codeGen/CgInfoTbls.hs
@@ -43,18 +43,10 @@ import Name
import DataCon
import Unique
import StaticFlags
-import FastString
-import Packages
-import Module
import Maybes
import Constants
-import Outputable
-
-import Data.Char
-import Data.Word
-
-------------------------------------------------------------------------
--
-- Generating the info table and code for a closure
diff --git a/compiler/coreSyn/MkExternalCore.lhs b/compiler/coreSyn/MkExternalCore.lhs
index de907cf214..9efc76f08e 100644
--- a/compiler/coreSyn/MkExternalCore.lhs
+++ b/compiler/coreSyn/MkExternalCore.lhs
@@ -10,16 +10,14 @@ module MkExternalCore (
#include "HsVersions.h"
import qualified ExternalCore as C
-import Char
import Module
import CoreSyn
import HscTypes
import TyCon
import TypeRep
import Type
-import PprExternalCore -- Instances
+import PprExternalCore () -- Instances
import DataCon
-import CoreSyn
import Coercion
import Var
import IdInfo
diff --git a/compiler/deSugar/Check.lhs b/compiler/deSugar/Check.lhs
index a81123ec41..b8c61aa9ce 100644
--- a/compiler/deSugar/Check.lhs
+++ b/compiler/deSugar/Check.lhs
@@ -11,7 +11,6 @@ module Check ( check , ExhaustivePat ) where
import HsSyn
import TcHsSyn
-import TcType
import DsUtils
import MatchLit
import Id
diff --git a/compiler/deSugar/DsGRHSs.lhs b/compiler/deSugar/DsGRHSs.lhs
index 4f1065e384..4e3dd2d15c 100644
--- a/compiler/deSugar/DsGRHSs.lhs
+++ b/compiler/deSugar/DsGRHSs.lhs
@@ -14,14 +14,12 @@ import {-# SOURCE #-} DsExpr ( dsLExpr, dsLocalBinds )
import {-# SOURCE #-} Match ( matchSinglePat )
import HsSyn
-import HsUtils
import CoreSyn
import Var
import Type
import DsMonad
import DsUtils
-import Unique
import PrelInfo
import TysWiredIn
import PrelNames
diff --git a/compiler/deSugar/DsListComp.lhs b/compiler/deSugar/DsListComp.lhs
index ccc1a7bb34..a98aef6b3a 100644
--- a/compiler/deSugar/DsListComp.lhs
+++ b/compiler/deSugar/DsListComp.lhs
@@ -21,7 +21,6 @@ import DsMonad -- the monadery used in the desugarer
import DsUtils
import DynFlags
-import StaticFlags
import CoreUtils
import Var
import Type
diff --git a/compiler/deSugar/DsMonad.lhs b/compiler/deSugar/DsMonad.lhs
index 577a0d822d..c9fe054d30 100644
--- a/compiler/deSugar/DsMonad.lhs
+++ b/compiler/deSugar/DsMonad.lhs
@@ -55,8 +55,6 @@ import NameEnv
import OccName
import DynFlags
import ErrUtils
-import Bag
-import OccName
import Data.IORef
diff --git a/compiler/deSugar/Match.lhs b/compiler/deSugar/Match.lhs
index 9dc5d3af3f..5294320212 100644
--- a/compiler/deSugar/Match.lhs
+++ b/compiler/deSugar/Match.lhs
@@ -26,7 +26,6 @@ import DataCon
import MatchCon
import MatchLit
import PrelInfo
-import TcType
import Type
import TysWiredIn
import BasicTypes
diff --git a/compiler/deSugar/MatchLit.lhs b/compiler/deSugar/MatchLit.lhs
index e0a76011b6..50fec2fd12 100644
--- a/compiler/deSugar/MatchLit.lhs
+++ b/compiler/deSugar/MatchLit.lhs
@@ -27,12 +27,10 @@ import TcType
import Type
import PrelNames
import TysWiredIn
-import PrelNames
import Unique
import Literal
import SrcLoc
import Ratio
-import SrcLoc
import Outputable
import Util
import FastString
diff --git a/compiler/hsSyn/HsBinds.lhs b/compiler/hsSyn/HsBinds.lhs
index 1d7bc2fa9b..9e08cf592a 100644
--- a/compiler/hsSyn/HsBinds.lhs
+++ b/compiler/hsSyn/HsBinds.lhs
@@ -17,7 +17,7 @@ import {-# SOURCE #-} HsExpr ( HsExpr, pprExpr, LHsExpr,
import {-# SOURCE #-} HsPat ( LPat )
import HsTypes
-import PprCore
+import PprCore ()
import Coercion
import Type
import Name
diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs
index 8689306e69..707de1cbf7 100644
--- a/compiler/iface/BuildTyCl.lhs
+++ b/compiler/iface/BuildTyCl.lhs
@@ -28,7 +28,6 @@ import Class
import TyCon
import Type
import Coercion
-import Outputable
import Data.List
\end{code}
diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs
index 1c8b410123..7fa2f1f7bc 100644
--- a/compiler/iface/LoadIface.lhs
+++ b/compiler/iface/LoadIface.lhs
@@ -38,7 +38,6 @@ import InstEnv
import FamInstEnv
import Name
import NameEnv
-import NameSet
import MkId
import Module
import OccName
@@ -52,7 +51,6 @@ import Outputable
import BinIface
import Panic
-import Control.Monad (when)
import Data.List
import Data.Maybe
import Data.IORef
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 45064beb58..16a1725983 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -30,7 +30,6 @@ import Packages
import HeaderInfo
import DriverPhases
import SysTools
-import qualified SysTools
import HscMain
import Finder
import HscTypes
@@ -60,7 +59,6 @@ import Control.Monad
import Data.List ( isSuffixOf )
import Data.Maybe
import System.Exit
-import System.Cmd
import System.Environment
-- ---------------------------------------------------------------------------
diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index 4f8fa14f2e..42cb31474d 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -31,15 +31,13 @@ module ErrUtils (
import Bag ( Bag, bagToList, isEmptyBag, emptyBag )
import SrcLoc ( SrcSpan )
-import Util ( sortLe, global )
+import Util ( sortLe )
import Outputable
-import qualified Pretty
import SrcLoc ( srcSpanStart, noSrcSpan )
import DynFlags ( DynFlags(..), DynFlag(..), dopt )
import StaticFlags ( opt_ErrorSpans )
import System.Exit ( ExitCode(..), exitWith )
-import System.IO ( hPutStrLn, stderr )
import Data.Dynamic
diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs
index e124e3755b..233ed1c358 100644
--- a/compiler/main/HeaderInfo.hs
+++ b/compiler/main/HeaderInfo.hs
@@ -23,7 +23,6 @@ import PrelNames ( gHC_PRIM, mAIN_NAME )
import StringBuffer ( StringBuffer(..), hGetStringBuffer, hGetStringBufferBlock
, appendStringBuffers )
import SrcLoc
-import FastString ( mkFastString )
import DynFlags
import ErrUtils
import Util
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index c9993a2f5a..17ed501dee 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -75,7 +75,6 @@ import GHC.IOBase ( IOErrorType(..) )
#else
import System.Process ( runInteractiveProcess, getProcessExitCode )
import Control.Concurrent( forkIO, newChan, readChan, writeChan )
-import Data.Char ( isSpace )
import FastString ( mkFastString )
import SrcLoc ( SrcLoc, mkSrcLoc, noSrcSpan, mkSrcSpan )
#endif
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
index 47c875c41d..ff3063c98d 100644
--- a/compiler/nativeGen/AsmCodeGen.lhs
+++ b/compiler/nativeGen/AsmCodeGen.lhs
@@ -26,16 +26,12 @@ import CmmOpt ( cmmMiniInline, cmmMachOpFold )
import PprCmm ( pprStmt, pprCmms )
import MachOp
import CLabel
-#if powerpc_TARGET_ARCH
-import CLabel ( mkRtsCodeLabel )
-#endif
import UniqFM
import Unique ( Unique, getUnique )
import UniqSupply
import FastTypes
import List ( groupBy, sortBy )
-import CLabel ( pprCLabel )
import ErrUtils ( dumpIfSet_dyn )
import DynFlags
import StaticFlags ( opt_Static, opt_PIC )
diff --git a/compiler/ndpFlatten/Flattening.hs b/compiler/ndpFlatten/Flattening.hs
index 18fc319e87..6072ad634f 100644
--- a/compiler/ndpFlatten/Flattening.hs
+++ b/compiler/ndpFlatten/Flattening.hs
@@ -55,12 +55,11 @@ module Flattening (
#include "HsVersions.h"
-- friends
-import NDPCoreUtils (tupleTyArgs, funTyArgs, parrElemTy, isDefault,
+import NDPCoreUtils (tupleTyArgs, funTyArgs, isDefault,
isLit, mkPArrTy, mkTuple, isSimpleExpr, substIdEnv)
import FlattenMonad (Flatten, runFlatten, mkBind, extendContext, packContext,
liftVar, liftConst, intersectWithContext, mk'fst,
- mk'lengthP, mk'replicateP, mk'mapP, mk'bpermuteDftP,
- mk'indexOfP,mk'eq,mk'neq)
+ mk'mapP, mk'bpermuteDftP, mk'indexOfP,mk'eq,mk'neq)
-- GHC
import TcType ( tcIsForAllTy, tcView )
@@ -75,9 +74,9 @@ import Literal (Literal, literalType)
import Var (Var(..), idType, isTyVar)
import Id (setIdType)
import DataCon (DataCon, dataConTag)
-import HscTypes ( ModGuts(..), ModGuts, HscEnv(..), hscEPS )
+import HscTypes ( ModGuts(..), HscEnv(..), hscEPS )
import CoreFVs (exprFreeVars)
-import CoreSyn (Expr(..), Bind(..), Alt(..), AltCon(..), Note(..),
+import CoreSyn (Expr(..), Bind(..), Alt, AltCon(..),
CoreBndr, CoreExpr, CoreBind, mkLams, mkLets,
mkApps, mkIntLitInt)
import PprCore (pprCoreExpr)
diff --git a/compiler/parser/HaddockLex.x b/compiler/parser/HaddockLex.x
index e4c2d2d933..e019e568b4 100644
--- a/compiler/parser/HaddockLex.x
+++ b/compiler/parser/HaddockLex.x
@@ -12,15 +12,12 @@ module HaddockLex (
tokenise
) where
-import HsSyn
import Lexer hiding (Token)
import Parser ( parseIdentifier )
import StringBuffer
-import OccName
import RdrName
import SrcLoc
import DynFlags
-import DynFlags
import Char
import Numeric
diff --git a/compiler/parser/LexCore.hs b/compiler/parser/LexCore.hs
index 9109c0469a..f16575f827 100644
--- a/compiler/parser/LexCore.hs
+++ b/compiler/parser/LexCore.hs
@@ -1,7 +1,6 @@
module LexCore where
import ParserCoreUtils
-import Ratio
import Char
import Numeric
diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs
index 8eea79705d..96088f400d 100644
--- a/compiler/parser/RdrHsSyn.lhs
+++ b/compiler/parser/RdrHsSyn.lhs
@@ -69,7 +69,6 @@ import OrdList ( OrdList, fromOL )
import Bag ( Bag, emptyBag, snocBag, consBag, foldrBag )
import Outputable
import FastString
-import Panic
import List ( isSuffixOf, nubBy )
import Monad ( unless )
diff --git a/compiler/profiling/SCCfinal.lhs b/compiler/profiling/SCCfinal.lhs
index 7aaf109697..601aff4cd1 100644
--- a/compiler/profiling/SCCfinal.lhs
+++ b/compiler/profiling/SCCfinal.lhs
@@ -39,7 +39,6 @@ import UniqSupply ( splitUniqSupply, UniqSupply )
#ifdef PROF_DO_BOXING
import UniqSupply ( uniqFromSupply )
#endif
-import Unique ( Unique )
import VarSet
import ListSetOps ( removeDups )
import Outputable
diff --git a/compiler/simplCore/LiberateCase.lhs b/compiler/simplCore/LiberateCase.lhs
index 01e410dfb7..02a3fab567 100644
--- a/compiler/simplCore/LiberateCase.lhs
+++ b/compiler/simplCore/LiberateCase.lhs
@@ -23,7 +23,6 @@ import Coercion
import TyCon
import VarEnv
import Name ( localiseName )
-import Outputable
import Util ( notNull )
import Data.IORef ( readIORef )
\end{code}
diff --git a/compiler/simplStg/SRT.lhs b/compiler/simplStg/SRT.lhs
index eb3229f196..0081c95e0d 100644
--- a/compiler/simplStg/SRT.lhs
+++ b/compiler/simplStg/SRT.lhs
@@ -15,9 +15,7 @@ import StgSyn
import Id ( Id )
import VarSet
import VarEnv
-import Util ( sortLe )
-import Maybes ( orElse )
-import Maybes ( expectJust )
+import Maybes ( orElse, expectJust )
import Bitmap ( intsToBitmap )
#ifdef DEBUG
@@ -27,7 +25,6 @@ import Outputable
import List
import Util
-import Outputable
\end{code}
\begin{code}
diff --git a/compiler/stgSyn/CoreToStg.lhs b/compiler/stgSyn/CoreToStg.lhs
index 614feba45d..a50a45ee36 100644
--- a/compiler/stgSyn/CoreToStg.lhs
+++ b/compiler/stgSyn/CoreToStg.lhs
@@ -19,7 +19,6 @@ import Type
import TyCon
import Id
import Var ( Var, globalIdDetails, idType )
-import TyCon ( isUnboxedTupleTyCon, isPrimTyCon, isFunTyCon, isHiBootTyCon )
import IdInfo
import DataCon
import CostCentre ( noCCS )
diff --git a/compiler/typecheck/TcEnv.lhs b/compiler/typecheck/TcEnv.lhs
index 8f4fbc9883..6d4cd46629 100644
--- a/compiler/typecheck/TcEnv.lhs
+++ b/compiler/typecheck/TcEnv.lhs
@@ -55,7 +55,6 @@ import TcMType
import TcType
import TcGadt
import qualified Type
-import Id
import Var
import VarSet
import VarEnv
diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs
index c78b469d88..1493b3aaf6 100644
--- a/compiler/typecheck/TcForeign.lhs
+++ b/compiler/typecheck/TcForeign.lhs
@@ -34,10 +34,8 @@ import Type
import SMRep
import MachOp
#endif
-import OccName
import Name
import TcType
-import ForeignCall
import DynFlags
import Outputable
import SrcLoc
diff --git a/compiler/typecheck/TcGadt.lhs b/compiler/typecheck/TcGadt.lhs
index 4cd7e004b2..cbb4230e74 100644
--- a/compiler/typecheck/TcGadt.lhs
+++ b/compiler/typecheck/TcGadt.lhs
@@ -24,7 +24,6 @@ import Coercion
import Type
import TypeRep
-import DataCon
import Var
import VarEnv
import VarSet
diff --git a/compiler/typecheck/TcHsSyn.lhs b/compiler/typecheck/TcHsSyn.lhs
index 9411a3a243..56c98dc139 100644
--- a/compiler/typecheck/TcHsSyn.lhs
+++ b/compiler/typecheck/TcHsSyn.lhs
@@ -35,12 +35,10 @@ import Id
import TcRnMonad
import Type
import TcType
-import qualified Type
import TcMType
import TysPrim
import TysWiredIn
import TyCon
-import {- Kind parts of -} Type
import Name
import Var
import VarSet
diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs
index 6c55a6232f..ef7e9293dd 100644
--- a/compiler/typecheck/TcRnDriver.lhs
+++ b/compiler/typecheck/TcRnDriver.lhs
@@ -88,6 +88,7 @@ import TysWiredIn
import IdInfo
import {- Kind parts of -} Type
import BasicTypes
+import Foreign.Ptr( Ptr )
#endif
import FastString
@@ -97,7 +98,6 @@ import Bag
import Control.Monad ( unless )
import Data.Maybe ( isJust )
-import Foreign.Ptr ( Ptr )
\end{code}
diff --git a/compiler/utils/BufWrite.hs b/compiler/utils/BufWrite.hs
index 049a698708..18f2864fbe 100644
--- a/compiler/utils/BufWrite.hs
+++ b/compiler/utils/BufWrite.hs
@@ -24,7 +24,6 @@ module BufWrite (
import FastString
import FastMutInt
-import Panic ( panic )
import Control.Monad ( when )
import Data.Char ( ord )
@@ -32,7 +31,6 @@ import Foreign
import System.IO
import GHC.IOBase ( IO(..) )
-import System.IO ( hPutBuf )
import GHC.Ptr ( Ptr(..) )
import GHC.Exts ( Int(..), Int#, Addr# )
diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs
index 53d75b05a9..300e7fcbcc 100644
--- a/compiler/utils/Panic.lhs
+++ b/compiler/utils/Panic.lhs
@@ -40,7 +40,7 @@ import GHC.ConsoleHandler
#endif
import Control.Exception
-import Control.Concurrent ( myThreadId, MVar, ThreadId, withMVar, newMVar )
+import Control.Concurrent ( MVar, ThreadId, withMVar, newMVar )
import Data.Dynamic
import qualified Control.Exception as Exception
import Debug.Trace ( trace )