From 05afb7485eea44d6410139f8a20c94b6f66c46f2 Mon Sep 17 00:00:00 2001 From: simonpj Date: Wed, 2 Jul 2003 14:59:12 +0000 Subject: [PATCH] [project @ 2003-07-02 14:59:00 by simonpj] Some random import trimming --- ghc/compiler/coreSyn/CorePrep.lhs | 2 +- ghc/compiler/deSugar/DsArrows.lhs | 10 +++++----- ghc/compiler/deSugar/DsExpr.lhs | 2 +- ghc/compiler/ghci/ByteCodeGen.lhs | 15 +++++---------- ghc/compiler/ghci/InteractiveUI.hs | 5 +++-- ghc/compiler/main/HscMain.lhs | 1 - ghc/compiler/ndpFlatten/FlattenMonad.hs | 1 - ghc/compiler/ndpFlatten/Flattening.hs | 2 +- ghc/compiler/simplCore/SimplCore.lhs | 3 +-- ghc/compiler/stgSyn/CoreToStg.lhs | 1 - ghc/compiler/typecheck/TcRnDriver.lhs | 20 +++++++++----------- ghc/compiler/typecheck/TcRules.lhs | 1 - ghc/compiler/typecheck/TcSplice.lhs | 6 +++--- 13 files changed, 29 insertions(+), 40 deletions(-) diff --git a/ghc/compiler/coreSyn/CorePrep.lhs b/ghc/compiler/coreSyn/CorePrep.lhs index db05f6d..d2515c9 100644 --- a/ghc/compiler/coreSyn/CorePrep.lhs +++ b/ghc/compiler/coreSyn/CorePrep.lhs @@ -26,7 +26,7 @@ import Id ( mkSysLocal, idType, idNewDemandInfo, idArity, isLocalId, hasNoBinding, idNewStrictness, idUnfolding, isDataConWorkId_maybe ) -import HscTypes ( ModGuts(..), ModGuts, TypeEnv, typeEnvElts ) +import HscTypes ( TypeEnv, typeEnvElts ) import BasicTypes ( TopLevelFlag(..), isTopLevel, isNotTopLevel, RecFlag(..), isNonRec ) diff --git a/ghc/compiler/deSugar/DsArrows.lhs b/ghc/compiler/deSugar/DsArrows.lhs index 74050ef..ea0e42b 100644 --- a/ghc/compiler/deSugar/DsArrows.lhs +++ b/ghc/compiler/deSugar/DsArrows.lhs @@ -15,7 +15,7 @@ import DsUtils ( mkErrorAppDs, dsReboundNames, lookupReboundName ) import DsMonad -import HsSyn ( HsExpr(..), Pat(..), +import HsSyn ( HsExpr(..), Stmt(..), HsMatchContext(..), HsStmtContext(..), Match(..), GRHSs(..), GRHS(..), HsCmdTop(..), HsArrAppType(..), @@ -41,12 +41,12 @@ import TcType ( Type, tcSplitAppTy ) import Type ( mkTyConApp ) import CoreSyn import CoreFVs ( exprFreeVars ) -import CoreUtils ( exprType, mkIfThenElse, bindNonRec ) +import CoreUtils ( mkIfThenElse, bindNonRec ) import Id ( Id, idType ) import PrelInfo ( pAT_ERROR_ID ) -import DataCon ( DataCon, dataConWrapId ) -import TysWiredIn ( tupleCon, mkTupleTy ) +import DataCon ( dataConWrapId ) +import TysWiredIn ( tupleCon ) import BasicTypes ( Boxity(..) ) import PrelNames ( eitherTyConName, leftDataConName, rightDataConName, arrAName, composeAName, firstAName, @@ -55,7 +55,7 @@ import Util ( mapAccumL ) import Outputable import HsPat ( collectPatBinders, collectPatsBinders ) -import VarSet ( IdSet, emptyVarSet, mkVarSet, varSetElems, +import VarSet ( IdSet, mkVarSet, varSetElems, intersectVarSet, minusVarSet, unionVarSet, unionVarSets, elemVarSet ) import SrcLoc ( SrcLoc ) diff --git a/ghc/compiler/deSugar/DsExpr.lhs b/ghc/compiler/deSugar/DsExpr.lhs index 2865f94..6ef07ff 100644 --- a/ghc/compiler/deSugar/DsExpr.lhs +++ b/ghc/compiler/deSugar/DsExpr.lhs @@ -54,7 +54,7 @@ import DataCon ( DataCon, dataConWrapId, dataConFieldLabels, dataConInstOrigArg import DataCon ( isExistentialDataCon ) import Name ( Name ) import TyCon ( tyConDataCons ) -import TysWiredIn ( tupleCon, mkTupleTy ) +import TysWiredIn ( tupleCon ) import BasicTypes ( RecFlag(..), Boxity(..), ipNameName ) import PrelNames ( toPName, returnMName, bindMName, thenMName, failMName, diff --git a/ghc/compiler/ghci/ByteCodeGen.lhs b/ghc/compiler/ghci/ByteCodeGen.lhs index b5ce3fc..784ac8b 100644 --- a/ghc/compiler/ghci/ByteCodeGen.lhs +++ b/ghc/compiler/ghci/ByteCodeGen.lhs @@ -19,8 +19,7 @@ import Name ( Name, getName, mkSystemName ) import Id import FiniteMap import ForeignCall ( ForeignCall(..), CCallTarget(..), CCallSpec(..) ) -import HscTypes ( ModGuts(..), ModGuts, - TypeEnv, typeEnvTyCons, typeEnvClasses ) +import HscTypes ( TypeEnv, typeEnvTyCons, typeEnvClasses ) import CoreUtils ( exprType ) import CoreSyn import PprCore ( pprCoreExpr ) @@ -28,21 +27,19 @@ import Literal ( Literal(..), literalPrimRep ) import PrimRep import PrimOp ( PrimOp(..) ) import CoreFVs ( freeVars ) -import Type ( typePrimRep, isUnLiftedType, splitTyConApp_maybe, - isTyVarTy ) +import Type ( typePrimRep, isUnLiftedType, splitTyConApp_maybe ) import DataCon ( DataCon, dataConTag, fIRST_TAG, dataConTyCon, isUnboxedTupleCon, isNullaryDataCon, dataConWorkId, dataConRepArity ) import TyCon ( tyConFamilySize, isDataTyCon, tyConDataCons, - isFunTyCon, isUnboxedTupleTyCon ) + isUnboxedTupleTyCon ) import Class ( Class, classTyCon ) import Type ( Type, repType, splitFunTys, dropForAlls ) import Util import DataCon ( dataConRepArity ) import Var ( isTyVar ) import VarSet ( VarSet, varSetElems ) -import TysPrim ( foreignObjPrimTyCon, - arrayPrimTyCon, mutableArrayPrimTyCon, +import TysPrim ( arrayPrimTyCon, mutableArrayPrimTyCon, byteArrayPrimTyCon, mutableByteArrayPrimTyCon ) import PrimRep ( isFollowableRep ) @@ -56,7 +53,6 @@ import SMRep ( arrWordsHdrSize, arrPtrsHdrSize, StgWord ) import Bitmap ( intsToReverseBitmap, mkBitmap ) import OrdList import Constants ( wORD_SIZE ) -import BasicTypes ( TopLevelFlag(..), isTopLevel, isNotTopLevel ) import Data.List ( intersperse, sortBy, zip4, zip5, partition ) import Foreign ( Ptr, castPtr, mallocBytes, pokeByteOff, Word8 ) @@ -65,9 +61,8 @@ import Control.Exception ( throwDyn ) import GHC.Exts ( Int(..), ByteArray# ) -import Control.Monad ( when, mapAndUnzipM ) +import Control.Monad ( when ) import Data.Char ( ord ) -import Data.Bits -- ----------------------------------------------------------------------------- -- Generating byte code for a complete module diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index a073ceb..d8f291c 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,6 +1,6 @@ {-# OPTIONS -#include "Linker.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.154 2003/05/21 12:38:37 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.155 2003/07/02 14:59:07 simonpj Exp $ -- -- GHC Interactive User Interface -- @@ -22,7 +22,7 @@ import HsSyn ( TyClDecl(..), ConDecl(..), Sig(..) ) import MkIface ( ifaceTyThing ) import DriverFlags import DriverState -import DriverUtil ( remove_spaces, handle ) +import DriverUtil ( remove_spaces ) import Linker ( showLinkerState, linkPackages ) import Util import IdInfo ( GlobalIdDetails(..) ) @@ -46,6 +46,7 @@ import Config #ifndef mingw32_HOST_OS import System.Posix +import DriverUtil( handle ) #if __GLASGOW_HASKELL__ > 504 hiding (getEnv) #endif diff --git a/ghc/compiler/main/HscMain.lhs b/ghc/compiler/main/HscMain.lhs index 8bcd749..e920e7b 100644 --- a/ghc/compiler/main/HscMain.lhs +++ b/ghc/compiler/main/HscMain.lhs @@ -50,7 +50,6 @@ import Flattening ( flatten ) import SimplCore import TidyPgm ( tidyCorePgm ) import CorePrep ( corePrepPgm ) -import StgSyn import CoreToStg ( coreToStg ) import SimplStg ( stg2stg ) import CodeGen ( codeGen ) diff --git a/ghc/compiler/ndpFlatten/FlattenMonad.hs b/ghc/compiler/ndpFlatten/FlattenMonad.hs index beb5f16..b8a2114 100644 --- a/ghc/compiler/ndpFlatten/FlattenMonad.hs +++ b/ghc/compiler/ndpFlatten/FlattenMonad.hs @@ -64,7 +64,6 @@ module FlattenMonad ( import Monad (mplus) -- GHC -import CmdLineOpts (opt_Flatten) import Panic (panic) import Outputable (Outputable(ppr), pprPanic) import UniqSupply (UniqSupply, splitUniqSupply, uniqFromSupply) diff --git a/ghc/compiler/ndpFlatten/Flattening.hs b/ghc/compiler/ndpFlatten/Flattening.hs index 51a5d9a..4f0f86b 100644 --- a/ghc/compiler/ndpFlatten/Flattening.hs +++ b/ghc/compiler/ndpFlatten/Flattening.hs @@ -56,7 +56,7 @@ module Flattening ( -- friends import NDPCoreUtils (tupleTyArgs, funTyArgs, parrElemTy, isDefault, - isLit, mkPArrTy, mkTuple, isSimpleExpr, boolTy, substIdEnv) + 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, diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs index 033a3d4..be781e6 100644 --- a/ghc/compiler/simplCore/SimplCore.lhs +++ b/ghc/compiler/simplCore/SimplCore.lhs @@ -14,8 +14,7 @@ import CmdLineOpts ( CoreToDo(..), SimplifierSwitch(..), ) import CoreSyn import CoreFVs ( ruleRhsFreeVars ) -import HscTypes ( PersistentCompilerState(..), ExternalPackageState(..), - HscEnv(..), GhciMode(..), +import HscTypes ( HscEnv(..), GhciMode(..), ModGuts(..), ModGuts, Avails, availsToNameSet, PackageRuleBase, HomePackageTable, ModDetails(..), HomeModInfo(..) diff --git a/ghc/compiler/stgSyn/CoreToStg.lhs b/ghc/compiler/stgSyn/CoreToStg.lhs index 358d29f..603d2dd 100644 --- a/ghc/compiler/stgSyn/CoreToStg.lhs +++ b/ghc/compiler/stgSyn/CoreToStg.lhs @@ -17,7 +17,6 @@ import StgSyn import Type import TyCon ( isAlgTyCon ) -import Literal import Id import Var ( Var, globalIdDetails, varType ) import TyCon ( isUnboxedTupleTyCon, isPrimTyCon, isFunTyCon ) diff --git a/ghc/compiler/typecheck/TcRnDriver.lhs b/ghc/compiler/typecheck/TcRnDriver.lhs index 4f22d54..ade0e60 100644 --- a/ghc/compiler/typecheck/TcRnDriver.lhs +++ b/ghc/compiler/typecheck/TcRnDriver.lhs @@ -22,7 +22,6 @@ import DsMeta ( templateHaskellNames ) import CmdLineOpts ( DynFlag(..), opt_PprStyle_Debug, dopt ) import DriverState ( v_MainModIs, v_MainFunIs ) -import DriverUtil ( split_longest_prefix ) import HsSyn ( HsModule(..), HsBinds(..), MonoBinds(..), HsExpr(..), Stmt(..), Pat(VarPat), HsStmtContext(..), RuleDecl(..), HsGroup(..), SpliceDecl(..), @@ -36,7 +35,6 @@ import PrelNames ( iNTERACTIVE, ioTyConName, printName, monadNames, returnIOName, runIOName, dollarMainName, itName, mAIN_Name, unsafeCoerceName ) -import MkId ( unsafeCoerceId ) import RdrName ( RdrName, getRdrName, mkRdrUnqual, lookupRdrEnv, elemRdrEnv ) @@ -49,12 +47,10 @@ import TcHsSyn ( TypecheckedHsExpr, TypecheckedRuleDecl, import TcExpr ( tcInferRho, tcCheckRho ) import TcRnMonad -import TcMType ( newTyVarTy, zonkTcType ) -import TcType ( Type, liftedTypeKind, +import TcType ( Type, tyVarsOfType, tcFunResultTy, tidyTopType, mkForAllTys, mkFunTys, mkTyConApp, tcSplitForAllTys ) -import TcMatches ( tcStmtsAndThen, TcStmtCtxt(..) ) import Inst ( showLIE, tcStdSyntaxName ) import TcBinds ( tcTopBinds ) import TcClassDcl ( tcClassDecls2 ) @@ -77,21 +73,17 @@ import RnIfaces ( slurpImpDecls, checkVersions, RecompileRequired, outOfDate ) import RnHiFiles ( readIface, loadOldIface ) import RnEnv ( lookupSrcName, lookupOccRn, plusGlobalRdrEnv, ubiquitousNames, implicitModuleFVs, implicitStmtFVs, dataTcOccs ) -import RnExpr ( rnStmts, rnExpr ) import RnSource ( rnSrcDecls, checkModDeprec, rnStats ) import CoreUnfold ( unfoldingTemplate ) import CoreSyn ( IdCoreRule, Bind(..) ) import PprCore ( pprIdRules, pprCoreBindings ) -import TysWiredIn ( mkListTy, unitTy ) import ErrUtils ( mkDumpDoc, showPass, pprBagOfErrors ) import Id ( Id, mkLocalId, isLocalId, idName, idType, idUnfolding, setIdLocalExported ) -import IdInfo ( GlobalIdDetails(..) ) import Var ( Var, setGlobalIdDetails ) -import Module ( Module, ModuleName, mkHomeModule, mkModuleName, moduleName, moduleUserString, moduleEnvElts ) +import Module ( Module, mkHomeModule, mkModuleName, moduleName, moduleUserString, moduleEnvElts ) import OccName ( mkVarOcc ) import Name ( Name, isExternalName, getSrcLoc, nameOccName ) -import NameEnv ( delListFromNameEnv ) import NameSet import TyCon ( tyConGenInfo ) import BasicTypes ( EP(..), RecFlag(..) ) @@ -111,9 +103,15 @@ import HscTypes ( PersistentCompilerState(..), InteractiveContext(..), extendLocalRdrEnv, emptyFixityEnv ) #ifdef GHCI +import TcMType ( zonkTcType ) +import TcMatches ( tcStmtsAndThen, TcStmtCtxt(..) ) import RdrName ( rdrEnvElts ) +import RnExpr ( rnStmts, rnExpr ) import RnHiFiles ( loadInterface ) import RnEnv ( mkGlobalRdrEnv ) +import TysWiredIn ( mkListTy, unitTy ) +import IdInfo ( GlobalIdDetails(..) ) +import NameEnv ( delListFromNameEnv ) import HscTypes ( GlobalRdrElt(..), GlobalRdrEnv, ImportReason(..), Provenance(..), isLocalGRE ) #endif @@ -532,7 +530,7 @@ initRnInteractive ictxt rn_thing = initRn CmdLineMode $ setLocalRdrEnv (ic_rn_local_env ictxt) $ rn_thing -#endif +#endif /* GHCI */ \end{code} %************************************************************************ diff --git a/ghc/compiler/typecheck/TcRules.lhs b/ghc/compiler/typecheck/TcRules.lhs index a26faa8..0367f69 100644 --- a/ghc/compiler/typecheck/TcRules.lhs +++ b/ghc/compiler/typecheck/TcRules.lhs @@ -15,7 +15,6 @@ import TcHsSyn ( TypecheckedRuleDecl, mkHsLet ) import TcRnMonad import TcSimplify ( tcSimplifyToDicts, tcSimplifyInferCheck ) import TcMType ( newTyVarTy ) -import TcUnify ( Expected(..) ) import TcType ( tyVarsOfTypes, openTypeKind ) import TcIfaceSig ( tcCoreExpr, tcCoreLamBndrs ) import TcMonoType ( tcHsSigType, UserTypeCtxt(..), tcAddScopedTyVars ) diff --git a/ghc/compiler/typecheck/TcSplice.lhs b/ghc/compiler/typecheck/TcSplice.lhs index a63f6bd..53586be 100644 --- a/ghc/compiler/typecheck/TcSplice.lhs +++ b/ghc/compiler/typecheck/TcSplice.lhs @@ -15,7 +15,7 @@ import TcRnDriver ( importSupportingDecls, tcTopSrcDecls ) import qualified Language.Haskell.THSyntax as Meta -import HscTypes ( HscEnv(..), GhciMode(..), PersistentCompilerState(..), unQualInScope ) +import HscTypes ( HscEnv(..), PersistentCompilerState(..) ) import HsSyn ( HsBracket(..), HsExpr(..) ) import Convert ( convertToHsExpr, convertToHsDecls ) import RnExpr ( rnExpr ) @@ -24,7 +24,7 @@ import RnHsSyn ( RenamedHsExpr ) import TcExpr ( tcCheckRho, tcMonoExpr ) import TcHsSyn ( TcExpr, TypecheckedHsExpr, mkHsLet, zonkTopExpr ) import TcSimplify ( tcSimplifyTop, tcSimplifyBracket ) -import TcUnify ( Expected, unifyTauTy, zapExpectedTo, zapExpectedType ) +import TcUnify ( Expected, zapExpectedTo, zapExpectedType ) import TcType ( TcType, openTypeKind, mkAppTy ) import TcEnv ( spliceOK, tcMetaTy, tcWithTempInstEnv, bracketOK ) import TcRnTypes ( TopEnv(..) ) @@ -34,7 +34,7 @@ import Name ( Name ) import TcRnMonad import TysWiredIn ( mkListTy ) -import DsMeta ( expQTyConName, decQTyConName, typeQTyConName, decTyConName, qTyConName ) +import DsMeta ( expQTyConName, typeQTyConName, decTyConName, qTyConName ) import ErrUtils (Message) import Outputable import Panic ( showException ) -- 1.7.10.4