summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc/compiler/basicTypes/Id.lhs4
-rw-r--r--ghc/compiler/basicTypes/MkId.lhs7
-rw-r--r--ghc/compiler/basicTypes/SrcLoc.lhs2
-rw-r--r--ghc/compiler/codeGen/CgExpr.lhs5
-rw-r--r--ghc/compiler/codeGen/CgHeapery.lhs3
-rw-r--r--ghc/compiler/coreSyn/CorePrep.lhs4
-rw-r--r--ghc/compiler/coreSyn/ExternalCore.lhs1
-rw-r--r--ghc/compiler/main/Packages.lhs2
-rw-r--r--ghc/compiler/nativeGen/StixInfo.lhs1
-rw-r--r--ghc/compiler/nativeGen/StixMacro.lhs2
-rw-r--r--ghc/compiler/rename/ParseIface.y1
-rw-r--r--ghc/compiler/rename/RnEnv.lhs2
-rw-r--r--ghc/compiler/simplCore/FloatIn.lhs2
-rw-r--r--ghc/compiler/simplCore/SimplMonad.lhs4
-rw-r--r--ghc/compiler/simplCore/Simplify.lhs6
-rw-r--r--ghc/compiler/stranal/DmdAnal.lhs2
-rw-r--r--ghc/compiler/stranal/WwLib.lhs4
-rw-r--r--ghc/compiler/typecheck/Inst.lhs1
-rw-r--r--ghc/compiler/typecheck/TcMatches.lhs9
-rw-r--r--ghc/compiler/typecheck/TcMonad.lhs3
-rw-r--r--ghc/compiler/typecheck/TcMonoType.lhs6
-rw-r--r--ghc/compiler/typecheck/TcRules.lhs2
-rw-r--r--ghc/compiler/utils/Outputable.lhs2
-rw-r--r--ghc/compiler/utils/StringBuffer.lhs21
24 files changed, 39 insertions, 57 deletions
diff --git a/ghc/compiler/basicTypes/Id.lhs b/ghc/compiler/basicTypes/Id.lhs
index c4c3570031..ee1f20307b 100644
--- a/ghc/compiler/basicTypes/Id.lhs
+++ b/ghc/compiler/basicTypes/Id.lhs
@@ -90,9 +90,7 @@ import Type ( Type, typePrimRep, addFreeTyVars,
import IdInfo
import qualified Demand ( Demand )
-import NewDemand ( Demand, DmdResult(..), StrictSig, topSig, isBotRes,
- isBottomingSig, splitStrictSig, strictSigResInfo
- )
+import NewDemand ( Demand, StrictSig, topSig, isBottomingSig )
import Name ( Name, OccName,
mkSysLocalName, mkLocalName,
getOccName, getSrcLoc
diff --git a/ghc/compiler/basicTypes/MkId.lhs b/ghc/compiler/basicTypes/MkId.lhs
index f5998d2828..c112a2ab0e 100644
--- a/ghc/compiler/basicTypes/MkId.lhs
+++ b/ghc/compiler/basicTypes/MkId.lhs
@@ -45,7 +45,7 @@ import TcType ( Type, ThetaType, mkDictTy, mkPredTys, mkTyConApp,
tcSplitFunTys, tcSplitForAllTys, mkPredTy
)
import Module ( Module )
-import CoreUtils ( mkInlineMe, exprType )
+import CoreUtils ( exprType )
import CoreUnfold ( mkTopUnfolding, mkCompulsoryUnfolding, mkOtherCon )
import Literal ( Literal(..), nullAddrLit )
import TyCon ( TyCon, isNewTyCon, tyConTyVars, tyConDataCons,
@@ -71,10 +71,9 @@ import Id ( idType, mkGlobalId, mkVanillaGlobal, mkSysLocal,
)
import IdInfo ( IdInfo, noCafNoTyGenIdInfo,
setUnfoldingInfo,
- setArityInfo, setSpecInfo, setCgInfo, setCafInfo,
+ setArityInfo, setSpecInfo, setCafInfo,
newStrictnessFromOld, setAllStrictnessInfo,
- GlobalIdDetails(..), CafInfo(..), CprInfo(..),
- CgInfo
+ GlobalIdDetails(..), CafInfo(..), CprInfo(..)
)
import NewDemand ( mkStrictSig, strictSigResInfo, DmdResult(..),
mkTopDmdType, topDmd, evalDmd, lazyDmd,
diff --git a/ghc/compiler/basicTypes/SrcLoc.lhs b/ghc/compiler/basicTypes/SrcLoc.lhs
index 7e29d67bcc..3f89e97e3f 100644
--- a/ghc/compiler/basicTypes/SrcLoc.lhs
+++ b/ghc/compiler/basicTypes/SrcLoc.lhs
@@ -30,7 +30,7 @@ import Util ( thenCmp )
import Outputable
import FastString ( unpackFS )
import FastTypes
-import GlaExts ( Int(..), (+#) )
+import GlaExts ( (+#) )
\end{code}
%************************************************************************
diff --git a/ghc/compiler/codeGen/CgExpr.lhs b/ghc/compiler/codeGen/CgExpr.lhs
index a98a1bb848..c350218ab4 100644
--- a/ghc/compiler/codeGen/CgExpr.lhs
+++ b/ghc/compiler/codeGen/CgExpr.lhs
@@ -1,7 +1,7 @@
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgExpr.lhs,v 1.46 2001/10/25 02:13:11 sof Exp $
+% $Id: CgExpr.lhs,v 1.47 2001/11/19 16:34:12 simonpj Exp $
%
%********************************************************
%* *
@@ -41,8 +41,7 @@ import Id ( idPrimRep, idType, Id )
import VarSet
import PrimOp ( primOpOutOfLine, getPrimOpResultInfo, PrimOp(..), PrimOpResultInfo(..) )
import PrimRep ( PrimRep(..), isFollowableRep )
-import TyCon ( maybeTyConSingleCon,
- isUnboxedTupleTyCon, isEnumerationTyCon )
+import TyCon ( isUnboxedTupleTyCon, isEnumerationTyCon )
import Type ( Type, typePrimRep, tyConAppArgs, tyConAppTyCon, repType )
import Maybes ( maybeToBool )
import ListSetOps ( assocMaybe )
diff --git a/ghc/compiler/codeGen/CgHeapery.lhs b/ghc/compiler/codeGen/CgHeapery.lhs
index c85548450e..8c55d5795b 100644
--- a/ghc/compiler/codeGen/CgHeapery.lhs
+++ b/ghc/compiler/codeGen/CgHeapery.lhs
@@ -1,7 +1,7 @@
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgHeapery.lhs,v 1.26 2001/11/08 12:50:07 simonmar Exp $
+% $Id: CgHeapery.lhs,v 1.27 2001/11/19 16:34:12 simonpj Exp $
%
\section[CgHeapery]{Heap management functions}
@@ -31,7 +31,6 @@ import ClosureInfo ( closureSize, closureGoodStuffSize,
import PrimRep ( PrimRep(..), isFollowableRep )
import Unique ( Unique )
import CmdLineOpts ( opt_SccProfilingOn, opt_GranMacros )
-import Constants ( bLOCK_SIZE_W )
import GlaExts
import Outputable
diff --git a/ghc/compiler/coreSyn/CorePrep.lhs b/ghc/compiler/coreSyn/CorePrep.lhs
index 6f607b4aeb..1948974861 100644
--- a/ghc/compiler/coreSyn/CorePrep.lhs
+++ b/ghc/compiler/coreSyn/CorePrep.lhs
@@ -10,7 +10,7 @@ module CorePrep (
#include "HsVersions.h"
-import CoreUtils( exprIsAtom, exprType, exprIsValue, etaExpand, exprArity, exprOkForSpeculation )
+import CoreUtils( exprType, exprIsValue, etaExpand, exprArity, exprOkForSpeculation )
import CoreFVs ( exprFreeVars )
import CoreLint ( endPass )
import CoreSyn
@@ -29,7 +29,7 @@ import Id ( mkSysLocal, idType, idNewDemandInfo, idArity,
)
import HscTypes ( ModDetails(..), implicitTyThingIds, typeEnvElts )
import Unique ( mkBuiltinUnique )
-import BasicTypes ( Arity, TopLevelFlag(..), isTopLevel, isNotTopLevel,
+import BasicTypes ( TopLevelFlag(..), isTopLevel, isNotTopLevel,
RecFlag(..), isNonRec
)
import UniqSupply
diff --git a/ghc/compiler/coreSyn/ExternalCore.lhs b/ghc/compiler/coreSyn/ExternalCore.lhs
index 8ddc7daa76..2e86da9e6f 100644
--- a/ghc/compiler/coreSyn/ExternalCore.lhs
+++ b/ghc/compiler/coreSyn/ExternalCore.lhs
@@ -5,7 +5,6 @@
module ExternalCore where
-import List (elemIndex)
data Module
= Module Mname [Tdef] [Vdefg]
diff --git a/ghc/compiler/main/Packages.lhs b/ghc/compiler/main/Packages.lhs
index 94eeb96990..7c18904843 100644
--- a/ghc/compiler/main/Packages.lhs
+++ b/ghc/compiler/main/Packages.lhs
@@ -17,7 +17,7 @@ import Pretty
import CmdLineOpts ( dynFlag, verbosity )
import DriverUtil ( my_prefix_match )
import ErrUtils ( dumpIfSet )
-import Outputable ( docToSDoc, trace )
+import Outputable ( docToSDoc )
\end{code}
\begin{code}
diff --git a/ghc/compiler/nativeGen/StixInfo.lhs b/ghc/compiler/nativeGen/StixInfo.lhs
index c23306f47d..af6fa72af6 100644
--- a/ghc/compiler/nativeGen/StixInfo.lhs
+++ b/ghc/compiler/nativeGen/StixInfo.lhs
@@ -16,7 +16,6 @@ module StixInfo (
#include "NCG.h"
import AbsCSyn ( AbstractC(..), Liveness(..), C_SRT(..), needsSRT )
-import CLabel ( CLabel )
import StgSyn ( SRT(..) )
import ClosureInfo ( closurePtrsSize,
closureNonHdrSize, closureSMRep,
diff --git a/ghc/compiler/nativeGen/StixMacro.lhs b/ghc/compiler/nativeGen/StixMacro.lhs
index d3888eda6e..bcb2ba6a4b 100644
--- a/ghc/compiler/nativeGen/StixMacro.lhs
+++ b/ghc/compiler/nativeGen/StixMacro.lhs
@@ -21,7 +21,7 @@ import Stix
import UniqSupply ( returnUs, thenUs, UniqSM )
import CLabel ( mkBlackHoleInfoTableLabel, mkIndStaticInfoLabel,
mkIndInfoLabel, mkUpdInfoLabel, mkSeqInfoLabel,
- mkRtsGCEntryLabel, mkStgUpdatePAPLabel )
+ mkRtsGCEntryLabel )
\end{code}
The @ARGS_CHK_A{_LOAD_NODE}@ macros check for sufficient arguments on
diff --git a/ghc/compiler/rename/ParseIface.y b/ghc/compiler/rename/ParseIface.y
index e1795a3b8e..1fd883c58a 100644
--- a/ghc/compiler/rename/ParseIface.y
+++ b/ghc/compiler/rename/ParseIface.y
@@ -43,7 +43,6 @@ import BasicTypes ( Fixity(..), FixityDirection(..), StrictnessMark(..),
)
import CostCentre ( CostCentre(..), IsCafCC(..), IsDupdCC(..) )
import Type ( Kind, mkArrowKind, liftedTypeKind, openTypeKind, usageTypeKind )
-import IdInfo ( InlinePragInfo(..) )
import ForeignCall ( ForeignCall(..), CCallConv(..), CCallSpec(..), CCallTarget(..) )
import Lex
diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs
index 6b1fcb879f..11800c4acb 100644
--- a/ghc/compiler/rename/RnEnv.lhs
+++ b/ghc/compiler/rename/RnEnv.lhs
@@ -57,8 +57,6 @@ import List ( nub )
import UniqFM ( lookupWithDefaultUFM )
import CmdLineOpts
import FastString ( FastString )
-
-import Maybe ( isJust )
\end{code}
%*********************************************************
diff --git a/ghc/compiler/simplCore/FloatIn.lhs b/ghc/compiler/simplCore/FloatIn.lhs
index be854af217..295752014e 100644
--- a/ghc/compiler/simplCore/FloatIn.lhs
+++ b/ghc/compiler/simplCore/FloatIn.lhs
@@ -22,7 +22,7 @@ import CoreUtils ( exprIsValue, exprIsDupable )
import CoreLint ( showPass, endPass )
import CoreFVs ( CoreExprWithFVs, freeVars, freeVarsOf )
import Id ( isOneShotLambda )
-import Var ( Id, idType, isTyVar )
+import Var ( Id, idType )
import Type ( isUnLiftedType )
import VarSet
import Util ( zipEqual, zipWithEqual, count )
diff --git a/ghc/compiler/simplCore/SimplMonad.lhs b/ghc/compiler/simplCore/SimplMonad.lhs
index adaa6c44a3..cfd606dce1 100644
--- a/ghc/compiler/simplCore/SimplMonad.lhs
+++ b/ghc/compiler/simplCore/SimplMonad.lhs
@@ -52,9 +52,7 @@ module SimplMonad (
#include "HsVersions.h"
-import Id ( Id, idType, isDataConWrapId,
- idOccInfo, idInlinePragma
- )
+import Id ( Id, idType, idOccInfo, idInlinePragma )
import CoreSyn
import CoreUtils ( needsCaseBinding, exprIsTrivial )
import PprCore () -- Instances
diff --git a/ghc/compiler/simplCore/Simplify.lhs b/ghc/compiler/simplCore/Simplify.lhs
index 774fa57019..a318c667aa 100644
--- a/ghc/compiler/simplCore/Simplify.lhs
+++ b/ghc/compiler/simplCore/Simplify.lhs
@@ -38,15 +38,15 @@ import PprCore ( pprParendExpr, pprCoreExpr )
import CoreUnfold ( mkOtherCon, mkUnfolding, otherCons, callSiteInline )
import CoreUtils ( exprIsDupable, exprIsTrivial, needsCaseBinding,
exprIsConApp_maybe, mkPiTypes, findAlt,
- exprType, coreAltsType, exprIsValue,
+ exprType, exprIsValue,
exprOkForSpeculation, exprArity, findDefault,
mkCoerce, mkSCC, mkInlineMe, mkAltExpr, applyTypeToArg
)
import Rules ( lookupRule )
import BasicTypes ( isMarkedStrict )
import CostCentre ( currentCCS )
-import Type ( isUnLiftedType, seqType, mkFunTy, tyConAppArgs, funArgTy,
- funResultTy, splitFunTy_maybe, splitFunTy, eqType
+import Type ( isUnLiftedType, seqType, tyConAppArgs, funArgTy,
+ splitFunTy_maybe, splitFunTy, eqType
)
import Subst ( mkSubst, substTy, substExpr,
isInScope, lookupIdSubst, simplIdInfo
diff --git a/ghc/compiler/stranal/DmdAnal.lhs b/ghc/compiler/stranal/DmdAnal.lhs
index e5934e59bd..f23802ea40 100644
--- a/ghc/compiler/stranal/DmdAnal.lhs
+++ b/ghc/compiler/stranal/DmdAnal.lhs
@@ -31,7 +31,7 @@ import UniqFM ( plusUFM_C, addToUFM_Directly, lookupUFM_Directly,
keysUFM, minusUFM, ufmToList, filterUFM )
import Type ( isUnLiftedType )
import CoreLint ( showPass, endPass )
-import Util ( mapAndUnzip, mapAccumL, mapAccumR, lengthIs, equalLength )
+import Util ( mapAndUnzip, mapAccumL, mapAccumR, lengthIs )
import BasicTypes ( Arity, TopLevelFlag(..), isTopLevel, isNeverActive )
import Maybes ( orElse, expectJust )
import Outputable
diff --git a/ghc/compiler/stranal/WwLib.lhs b/ghc/compiler/stranal/WwLib.lhs
index 2d60dd21b9..996907d6bd 100644
--- a/ghc/compiler/stranal/WwLib.lhs
+++ b/ghc/compiler/stranal/WwLib.lhs
@@ -17,9 +17,7 @@ import Id ( Id, idType, mkSysLocal, idNewDemandInfo, setIdNewDemandInfo,
import IdInfo ( vanillaIdInfo )
import DataCon ( splitProductType_maybe, splitProductType )
import NewDemand ( Demand(..), DmdResult(..), Demands(..) )
-import DmdAnal ( both )
import MkId ( realWorldPrimId, voidArgId, eRROR_CSTRING_ID )
-import TysPrim ( realWorldStatePrimTy )
import TysWiredIn ( tupleCon )
import Type ( Type, isUnLiftedType, mkFunTys,
splitForAllTys, splitFunTys, splitNewType_maybe, isAlgType
@@ -27,7 +25,7 @@ import Type ( Type, isUnLiftedType, mkFunTys,
import Literal ( Literal(MachStr) )
import BasicTypes ( Boxity(..) )
import Var ( Var, isId )
-import UniqSupply ( returnUs, thenUs, getUniqueUs, getUniquesUs, UniqSM )
+import UniqSupply ( returnUs, thenUs, getUniquesUs, UniqSM )
import Util ( zipWithEqual )
import Outputable
import List ( zipWith4 )
diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs
index be2a441e23..4a1e4019a0 100644
--- a/ghc/compiler/typecheck/Inst.lhs
+++ b/ghc/compiler/typecheck/Inst.lhs
@@ -61,7 +61,6 @@ import Class ( Class )
import Id ( Id, idName, idType, mkUserLocal, mkSysLocal, mkLocalId )
import PrelInfo ( isStandardClass, isCcallishClass, isNoDictClass )
import Name ( Name, mkMethodOcc, getOccName )
-import NameSet ( NameSet )
import PprType ( pprPred )
import Subst ( emptyInScopeSet, mkSubst,
substTy, substTyWith, substTheta, mkTyVarSubst, mkTopTyVarSubst
diff --git a/ghc/compiler/typecheck/TcMatches.lhs b/ghc/compiler/typecheck/TcMatches.lhs
index cdd417fdfc..31cfa288a4 100644
--- a/ghc/compiler/typecheck/TcMatches.lhs
+++ b/ghc/compiler/typecheck/TcMatches.lhs
@@ -17,15 +17,13 @@ import HsSyn ( HsBinds(..), Match(..), GRHSs(..), GRHS(..),
pprMatch, getMatchLoc, pprMatchContext, isDoExpr,
mkMonoBind, nullMonoBinds, collectSigTysFromPats
)
-import RnHsSyn ( RenamedMatch, RenamedGRHSs, RenamedStmt, RenamedPat, RenamedHsType,
- RenamedMatchContext, extractHsTyVars )
+import RnHsSyn ( RenamedMatch, RenamedGRHSs, RenamedStmt, RenamedPat, RenamedMatchContext )
import TcHsSyn ( TcMatch, TcGRHSs, TcStmt, TcDictBinds, TypecheckedPat )
import TcMonad
-import TcMonoType ( kcHsSigTypes, tcAddScopedTyVars, checkSigTyVars, tcHsSigType, UserTypeCtxt(..), sigPatCtxt )
+import TcMonoType ( tcAddScopedTyVars, checkSigTyVars, tcHsSigType, UserTypeCtxt(..), sigPatCtxt )
import Inst ( LIE, isEmptyLIE, plusLIE, emptyLIE, plusLIEs, lieToList )
-import TcEnv ( TcId, tcLookupLocalIds, tcExtendLocalValEnv, tcExtendGlobalTyVars,
- tcInLocalScope )
+import TcEnv ( TcId, tcLookupLocalIds, tcExtendLocalValEnv, tcExtendGlobalTyVars )
import TcPat ( tcPat, tcMonoPatBndr, polyPatSig )
import TcMType ( newTyVarTy, unifyFunTy, unifyTauTy )
import TcType ( TcType, TcTyVar, tyVarsOfType, isTauTy,
@@ -36,7 +34,6 @@ import Name ( Name )
import TysWiredIn ( boolTy )
import Id ( idType )
import BasicTypes ( RecFlag(..) )
-import NameSet
import VarSet
import Var ( Id )
import Bag
diff --git a/ghc/compiler/typecheck/TcMonad.lhs b/ghc/compiler/typecheck/TcMonad.lhs
index 28743e2209..d613e07b6b 100644
--- a/ghc/compiler/typecheck/TcMonad.lhs
+++ b/ghc/compiler/typecheck/TcMonad.lhs
@@ -44,7 +44,7 @@ import {-# SOURCE #-} TcEnv ( TcEnv )
import HsLit ( HsOverLit )
import RnHsSyn ( RenamedPat, RenamedArithSeqInfo, RenamedHsExpr )
-import TcType ( Type, Kind, PredType, ThetaType, TyVarDetails )
+import TcType ( Type, Kind, TyVarDetails )
import ErrUtils ( addShortErrLocLine, addShortWarnLocLine, ErrMsg, Message, WarnMsg )
import Bag ( Bag, emptyBag, isEmptyBag,
@@ -53,7 +53,6 @@ import Class ( Class )
import Name ( Name )
import Var ( Id, TyVar, newMutTyVar, readMutTyVar, writeMutTyVar )
import VarEnv ( TidyEnv, emptyTidyEnv )
-import VarSet ( TyVarSet )
import UniqSupply ( UniqSupply, uniqFromSupply, uniqsFromSupply,
splitUniqSupply, mkSplitUniqSupply,
UniqSM, initUs_ )
diff --git a/ghc/compiler/typecheck/TcMonoType.lhs b/ghc/compiler/typecheck/TcMonoType.lhs
index ca4629a164..1ad297c832 100644
--- a/ghc/compiler/typecheck/TcMonoType.lhs
+++ b/ghc/compiler/typecheck/TcMonoType.lhs
@@ -35,7 +35,7 @@ import TcMType ( newKindVar, tcInstSigTyVars,
checkValidType, UserTypeCtxt(..), pprUserTypeCtxt
)
import TcType ( Type, Kind, SourceType(..), ThetaType, TyVarDetails(..),
- TcTyVar, TcTyVarSet, TcType, TcKind, TcThetaType, TcTauType,
+ TcTyVar, TcTyVarSet, TcKind, TcThetaType, TcTauType,
mkTyVarTy, mkTyVarTys, mkFunTy, mkSynTy,
tcSplitForAllTys, tcSplitRhoTy,
hoistForAllTys, allDistinctTyVars, zipFunTys,
@@ -52,11 +52,11 @@ import PprType ( pprType )
import Subst ( mkTopTyVarSubst, substTy )
import CoreFVs ( idFreeTyVars )
import Id ( mkLocalId, idName, idType )
-import Var ( Id, Var, TyVar, mkTyVar, tyVarKind, isMutTyVar, mutTyVarDetails )
+import Var ( Var, TyVar, mkTyVar, tyVarKind, isMutTyVar, mutTyVarDetails )
import VarEnv
import VarSet
import ErrUtils ( Message )
-import TyCon ( TyCon, isSynTyCon, tyConArity, tyConKind )
+import TyCon ( TyCon, isSynTyCon, tyConKind )
import Class ( classTyCon )
import Name ( Name, getSrcLoc )
import NameSet
diff --git a/ghc/compiler/typecheck/TcRules.lhs b/ghc/compiler/typecheck/TcRules.lhs
index e0aa172c92..7aefcac53c 100644
--- a/ghc/compiler/typecheck/TcRules.lhs
+++ b/ghc/compiler/typecheck/TcRules.lhs
@@ -18,7 +18,7 @@ import TcSimplify ( tcSimplifyToDicts, tcSimplifyInferCheck )
import TcMType ( newTyVarTy )
import TcType ( tyVarsOfTypes, openTypeKind )
import TcIfaceSig ( tcCoreExpr, tcCoreLamBndrs, tcVar, tcDelay )
-import TcMonoType ( kcHsSigTypes, tcHsSigType, UserTypeCtxt(..), tcAddScopedTyVars )
+import TcMonoType ( tcHsSigType, UserTypeCtxt(..), tcAddScopedTyVars )
import TcExpr ( tcExpr )
import TcEnv ( RecTcEnv, tcExtendLocalValEnv, isLocalThing )
import Rules ( extendRuleBase )
diff --git a/ghc/compiler/utils/Outputable.lhs b/ghc/compiler/utils/Outputable.lhs
index 2c79450863..96d611f0dd 100644
--- a/ghc/compiler/utils/Outputable.lhs
+++ b/ghc/compiler/utils/Outputable.lhs
@@ -57,7 +57,7 @@ import Pretty ( Doc, Mode(..), TextDetails(..), fullRender )
import Panic
import Word ( Word32 )
-import IO ( Handle, hPutChar, hPutStr, stderr, stdout )
+import IO ( Handle, stderr, stdout )
import Char ( chr )
#if __GLASGOW_HASKELL__ < 410
import Char ( ord, isDigit )
diff --git a/ghc/compiler/utils/StringBuffer.lhs b/ghc/compiler/utils/StringBuffer.lhs
index 1aedc7bc06..60686bbb90 100644
--- a/ghc/compiler/utils/StringBuffer.lhs
+++ b/ghc/compiler/utils/StringBuffer.lhs
@@ -69,31 +69,32 @@ module StringBuffer
#include "HsVersions.h"
-import GlaExts
+
#if __GLASGOW_HASKELL__ < 411
import PrelAddr ( Addr(..) )
+import Panic ( panic )
#else
import Addr ( Addr(..) )
+import Ptr ( Ptr(..) )
#endif
-import Foreign
+
+#if __GLASGOW_HASKELL__ >= 501
+import PrelIO ( hGetcBuffered )
+#else
import Char ( chr )
-import Panic ( panic )
+#endif
+
+import GlaExts
+import Foreign
import IO ( openFile )
import IOExts ( slurpFile )
import PrelIOBase
import PrelHandle
import Addr
-#if __GLASGOW_HASKELL__ >= 411
-import Ptr ( Ptr(..) )
-#endif
import PrelPack ( unpackCStringBA )
-#if __GLASGOW_HASKELL__ >= 501
-import PrelIO ( hGetcBuffered )
-#endif
-
import Exception ( bracket )
import PrimPacked
import FastString