Commit f37e239f authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Trim imports, and remove some dead code

parent 2c5337d3
......@@ -47,7 +47,7 @@ import TysPrim ( openAlphaTyVars, alphaTyVar, alphaTy,
import TysWiredIn ( charTy, mkListTy )
import PrelRules ( primOpRules )
import Type ( TyThing(..), mkForAllTy, tyVarsOfTypes,
newTyConInstRhs, mkTopTvSubst, substTyVar, substTy,
newTyConInstRhs, mkTopTvSubst, substTyVar,
substTys, zipTopTvSubst )
import TcGadt ( gadtRefine, refineType, emptyRefinement )
import HsBinds ( ExprCoFn(..), isIdCoercion )
......@@ -97,7 +97,6 @@ import NewDemand ( mkStrictSig, DmdResult(..),
import DmdAnal ( dmdAnalTopRhs )
import CoreSyn
import Unique ( mkBuiltinUnique, mkPrimOpIdUnique )
import Maybe ( fromJust )
import Maybes
import PrelNames
import Util ( dropList, isSingleton )
......
......@@ -15,8 +15,8 @@ import Id ( Id, mkUserLocal, idInfo, setIdInfo, idUnique, idType )
import IdInfo ( setArityInfo, vanillaIdInfo,
newStrictnessInfo, setAllStrictnessInfo,
newDemandInfo, setNewDemandInfo )
import Type ( tidyType, tidyTyVarBndr, substTy )
import Var ( Var, TyVar, varName )
import Type ( tidyType, tidyTyVarBndr )
import Var ( Var, varName )
import VarEnv
import UniqFM ( lookupUFM )
import Name ( Name, getOccName )
......
......@@ -37,7 +37,6 @@ import BasicTypes ( Version, initialVersion,
Fixity(..), FixityDirection(..), isMarkedStrict )
import TcRnMonad
import Type ( TyThing(..) )
import Class ( classATs )
import PrelNames ( gHC_PRIM )
import PrelInfo ( ghcPrimExports )
......@@ -52,7 +51,7 @@ import Module
import OccName ( OccName, mkOccEnv, lookupOccEnv, mkClassTyConOcc,
mkClassDataConOcc, mkSuperDictSelOcc,
mkDataConWrapperOcc, mkDataConWorkerOcc,
mkNewTyCoOcc, mkInstTyTcOcc, mkInstTyCoOcc )
mkNewTyCoOcc, mkInstTyCoOcc )
import SrcLoc ( importedSrcLoc )
import Maybes ( MaybeErr(..) )
import ErrUtils ( Message )
......
......@@ -27,18 +27,15 @@ import TcRnMonad
import Type ( liftedTypeKind, splitTyConApp, mkTyConApp,
liftedTypeKindTyCon, unliftedTypeKindTyCon,
openTypeKindTyCon, argTypeKindTyCon,
ubxTupleKindTyCon,
mkTyVarTys, ThetaType )
ubxTupleKindTyCon, ThetaType )
import TypeRep ( Type(..), PredType(..) )
import TyCon ( TyCon, tyConName, SynTyConRhs(..),
AlgTyConParent(..), setTyConArgPoss )
import TyCon ( TyCon, tyConName, SynTyConRhs(..), setTyConArgPoss )
import HscTypes ( ExternalPackageState(..),
TyThing(..), tyThingClass, tyThingTyCon,
ModIface(..), ModDetails(..), HomeModInfo(..),
emptyModDetails, lookupTypeEnv, lookupType,
typeEnvIds, mkDetailsFamInstCache )
import InstEnv ( Instance(..), mkImportedInstance )
import FamInstEnv ( extractFamInsts )
import CoreSyn
import CoreUtils ( exprType, dataConRepFSInstPat )
import CoreUnfold
......@@ -52,9 +49,9 @@ import IdInfo ( IdInfo, CafInfo(..), WorkerInfo(..),
vanillaIdInfo, newStrictnessInfo )
import Class ( Class )
import TyCon ( tyConDataCons, isTupleTyCon, mkForeignTyCon )
import DataCon ( DataCon, dataConWorkId, dataConExTyVars, dataConInstArgTys )
import DataCon ( DataCon, dataConWorkId )
import TysWiredIn ( tupleCon, tupleTyCon, listTyCon, intTyCon, boolTyCon, charTyCon, parrTyCon )
import Var ( TyVar, mkTyVar, tyVarKind )
import Var ( TyVar, mkTyVar )
import Name ( Name, nameModule, nameIsLocalOrFrom, isWiredInName,
nameOccName, wiredInNameTyThing_maybe )
import NameEnv
......@@ -68,12 +65,11 @@ import Outputable
import ErrUtils ( Message )
import Maybes ( MaybeErr(..) )
import SrcLoc ( noSrcLoc )
import Util ( zipWithEqual, equalLength, splitAtList )
import Util ( zipWithEqual, equalLength )
import DynFlags ( DynFlag(..), isOneShot )
import List ( elemIndex)
import Maybe ( catMaybes )
import Monad ( liftM )
\end{code}
This module takes
......
......@@ -20,7 +20,7 @@ module PrelRules ( primOpRules, builtinRules ) where
#include "HsVersions.h"
import CoreSyn
import Id ( mkWildId, isPrimOpId_maybe, idUnfolding )
import Id ( mkWildId, idUnfolding )
import Literal ( Literal(..), mkMachInt, mkMachWord
, literalType
, word2IntLit, int2WordLit
......
......@@ -23,7 +23,6 @@ import HsSyn
import RnHsSyn
import TcRnMonad
import RnEnv
import OccName ( plusOccEnv )
import RnNames ( getLocalDeclBinders, extendRdrEnvRn )
import RnTypes ( rnHsTypeFVs, rnLPat, rnOverLit, rnPatsAndThen, rnLit,
mkOpFormRn, mkOpAppRn, mkNegAppRn, checkSectionPrec,
......@@ -43,7 +42,7 @@ import Name ( isTyVarName )
#endif
import Name ( Name, nameOccName, nameIsLocalOrFrom )
import NameSet
import RdrName ( RdrName, emptyGlobalRdrEnv, extendLocalRdrEnv, lookupLocalRdrEnv, hideSomeUnquals )
import RdrName ( RdrName, extendLocalRdrEnv, lookupLocalRdrEnv, hideSomeUnquals )
import LoadIface ( loadInterfaceForName )
import UniqFM ( isNullUFM )
import UniqSet ( emptyUniqSet )
......@@ -968,10 +967,10 @@ mkBreakpointExpr' breakpointFunc scope
mkScopeArg args = unLoc $ mkExpr undef (map HsVar args)
msg = srcSpanLit sloc
return (expr, emptyFVs)
#endif
srcSpanLit :: SrcSpan -> HsExpr Name
srcSpanLit span = HsLit (HsString (mkFastString (showSDoc (ppr span))))
#endif
srcSpanPrimLit :: SrcSpan -> HsExpr Name
srcSpanPrimLit span = HsLit (HsStringPrim (mkFastString (showSDoc (ppr span))))
......
......@@ -26,8 +26,6 @@ import Id ( Id, idType, idInfo, idArity, isDataConWorkId,
idNewDemandInfo, setIdInfo,
setIdOccInfo, zapLamIdInfo, setOneShotLambda
)
import MkId ( eRROR_ID )
import Literal ( mkStringLit )
import IdInfo ( OccInfo(..), isLoopBreaker,
setArityInfo, zapDemandInfo,
setUnfoldingInfo,
......@@ -35,7 +33,7 @@ import IdInfo ( OccInfo(..), isLoopBreaker,
)
import NewDemand ( isStrictDmd )
import TcGadt ( dataConCanMatch )
import DataCon ( DataCon, dataConTyCon, dataConRepStrictness )
import DataCon ( dataConTyCon, dataConRepStrictness )
import TyCon ( tyConArity, isAlgTyCon, isNewTyCon, tyConDataCons_maybe )
import CoreSyn
import PprCore ( pprParendExpr, pprCoreExpr )
......@@ -51,13 +49,11 @@ import Rules ( lookupRule )
import BasicTypes ( isMarkedStrict )
import CostCentre ( currentCCS )
import Type ( TvSubstEnv, isUnLiftedType, seqType, tyConAppArgs, funArgTy,
splitFunTy_maybe, splitFunTy, coreEqType, splitTyConApp_maybe,
isTyVarTy, mkTyVarTys, isFunTy, tcEqType
coreEqType, splitTyConApp_maybe,
isTyVarTy, isFunTy, tcEqType
)
import Coercion ( Coercion, coercionKind,
mkTransCoercion, mkLeftCoercion, mkRightCoercion,
mkSymCoercion, splitCoercionKind_maybe, decomposeCo )
import Var ( tyVarKind, mkTyVar )
mkTransCoercion, mkSymCoercion, splitCoercionKind_maybe, decomposeCo )
import VarEnv ( elemVarEnv, emptyVarEnv )
import TysPrim ( realWorldStatePrimTy )
import PrelInfo ( realWorldPrimId )
......
......@@ -34,7 +34,7 @@ import SMRep ( argMachRep, primRepToCgRep, primRepHint )
#endif
import OccName ( mkForeignExportOcc )
import Name ( Name, NamedThing(..), mkExternalName )
import TcType ( Type, tcSplitFunTys, tcSplitTyConApp_maybe,
import TcType ( Type, tcSplitFunTys,
tcSplitForAllTys, tcSplitIOType_maybe,
isFFIArgumentTy, isFFIImportResultTy,
isFFIExportResultTy, isFFILabelTy,
......@@ -45,7 +45,6 @@ import TcType ( Type, tcSplitFunTys, tcSplitTyConApp_maybe,
import ForeignCall ( CExportSpec(..), CCallTarget(..),
CLabelString, isCLabelString,
isDynamicTarget, withDNTypes, DNKind(..), DNCallSpec(..) )
import PrelNames ( hasKey, ioTyConKey )
import DynFlags ( DynFlags(..), HscTarget(..) )
import Outputable
import SrcLoc ( Located(..), srcSpanStart )
......
......@@ -61,7 +61,7 @@ module TyCon(
#include "HsVersions.h"
import {-# SOURCE #-} TypeRep ( Kind, Type, Coercion, PredType )
import {-# SOURCE #-} TypeRep ( Kind, Type, PredType )
import {-# SOURCE #-} DataCon ( DataCon, isVanillaDataCon )
import Var ( TyVar, Id )
......@@ -194,10 +194,6 @@ data TyCon
tyConName :: Name
}
type KindCon = TyCon
type SuperKindCon = TyCon
type FieldLabel = Name
data AlgTyConRhs
......
......@@ -117,12 +117,12 @@ import PrelNames( openTypeKindTyConKey, unliftedTypeKindTyConKey,
ubxTupleKindTyConKey, argTypeKindTyConKey )
import TyCon ( TyCon, isRecursiveTyCon, isPrimTyCon,
isUnboxedTupleTyCon, isUnLiftedTyCon,
isFunTyCon, isNewTyCon, isClosedNewTyCon, isOpenTyCon,
isFunTyCon, isNewTyCon, isClosedNewTyCon,
newTyConRep, newTyConRhs,
isAlgTyCon, tyConArity, isSuperKindTyCon,
tcExpandTyCon_maybe, coreExpandTyCon_maybe,
tyConKind, PrimRep(..), tyConPrimRep, tyConUnique,
isCoercionTyCon_maybe, isCoercionTyCon
isCoercionTyCon
)
-- others
......
\begin{code}
module TypeRep where
import {-# SOURCE #-} TyCon ( TyCon )
data Type
data PredType
data TyThing
type Coercion = Type
type Kind = Type
type SuperKind = Type
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment