%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgCase.lhs,v 1.39 2000/03/25 12:38:40 panne Exp $
+% $Id: CgCase.lhs,v 1.40 2000/03/27 16:22:09 simonpj Exp $
%
%********************************************************
%* *
tyConDataCons, tyConFamilySize )
import Type ( Type, typePrimRep, splitAlgTyConApp,
splitTyConApp_maybe, repType )
-import PprType ( {- instance Outputable Type -} )
import Unique ( Unique, Uniquable(..), mkPseudoUnique1 )
import Maybes ( maybeToBool )
import Util
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgExpr.lhs,v 1.32 2000/03/25 12:38:40 panne Exp $
+% $Id: CgExpr.lhs,v 1.33 2000/03/27 16:22:09 simonpj Exp $
%
%********************************************************
%* *
import TyCon ( maybeTyConSingleCon,
isUnboxedTupleTyCon, isEnumerationTyCon )
import Type ( Type, typePrimRep, splitTyConApp_maybe, repType )
-import PprType ( {- instance Outputable Type -} )
import Maybes ( assocMaybe, maybeToBool )
import Unique ( mkBuiltinUnique )
import BasicTypes ( TopLevelFlag(..), RecFlag(..) )
isUnboxedTupleType,
hasMoreBoxityInfo
)
-import PprType ( {- instance Outputable Type -} )
import TyCon ( TyCon, isPrimTyCon, tyConDataCons )
import BasicTypes ( RecFlag(..), isNonRec )
import Outputable
import Type ( isUnLiftedType, splitAlgTyConApp_maybe, mkFunTys,
splitTyConApp_maybe, tyVarsOfType, mkForAllTys, Type
)
-import PprType ( {- instance Outputable Type -} )
import TysPrim ( byteArrayPrimTy, realWorldStatePrimTy,
byteArrayPrimTyCon, mutableByteArrayPrimTyCon )
import TysWiredIn ( unitDataConId, stringTy,
isNotUsgTy, unUsgTy,
splitAppTy, isUnLiftedType, Type
)
-import PprType ( {- instance Outputable Type -} )
import TysWiredIn ( tupleCon, unboxedTupleCon,
listTyCon, mkListTy,
charDataCon, charTy, stringTy,
Type, mkFunTys, mkForAllTys, mkTyConApp,
mkTyVarTy, mkFunTy, splitAppTy
)
-import PprType ( {- instance Outputable Type -} )
import PrimOp ( PrimOp(..), CCall(..), CCallTarget(..) )
import Var ( TyVar )
import TysPrim ( realWorldStatePrimTy, addrPrimTy )
import Literal ( Literal )
import PrimOp ( CCall, pprCCallOp )
import Type ( Kind )
-import PprType ( {- instance Outputable Kind -} )
import CostCentre
import SrcLoc ( SrcLoc )
import Outputable
-- either are dependent via a non-library module
-- or contain orphan rules or instance decls
- -- Don't ditch a module that's already loaded
- -- If it isn't loaded, and together the is_boot-ness
- combine old@(_, _, _, Just _) new = old
- combine old@(_, _, old_is_boot, Nothing)
- new@(version, has_orphans, new_is_boot, _)
- = (version, has_orphans, old_is_boot && new_is_boot, Nothing)
+ combine old@(_, _, old_is_boot, cts) new
+ | maybeToBool cts || not old_is_boot = old -- Keep the old info if it's already loaded
+ -- or if it's a non-boot pending load
+ | otherwise = new -- Otherwise pick new info
loadExport :: ModuleName -> ExportItem -> RnM d [AvailInfo]
loadExport this_mod (mod, entities)
-- I can't be bothered just now.
mk_version_info mod_name (version, has_orphans, is_boot, contents) so_far
+ | mod_name == this_mod -- Check if M appears in the set of modules 'below' M
+ -- This seems like a convenient place to check
+ = WARN( not is_boot, ptext SLIT("Wierd:") <+> ppr this_mod <+>
+ ptext SLIT("imports itself (perhaps indirectly)") )
+ so_far
+
+ | otherwise
= let
go_for_it exports = (mod_name, version, has_orphans, is_boot, exports)
: so_far
is_lib_module = isLibModule mod
in
- -- A module shouldn't load its own interface
- -- This seems like a convenient place to check
- WARN( maybeToBool (lookupFM mod_map this_mod),
- ptext SLIT("Wierd:") <+> ppr this_mod <+> ptext SLIT("loads its own interface") )
returnRn (foldFM mk_version_info [] mod_map)
where
import Type ( Type, tyVarsOfType, tyVarsOfTypes, mkForAllTys, seqType,
splitTyConApp_maybe, splitAlgTyConApp_maybe, mkTyVarTys, applyTys, splitFunTys, mkFunTys
)
-import PprType ( {- instance Outputable Type -} )
import DataCon ( dataConRepArity )
import TysPrim ( statePrimTyCon )
import Var ( setVarUnique )
tyVarsOfType, tyVarsOfTypes, tyVarsOfTheta, applyTys,
mkForAllTys, boxedTypeKind
)
-import PprType ( {- instance Outputable Type -} )
import Subst ( Subst, mkSubst, substTy, emptySubst, substBndrs, extendSubstList,
substId, substAndCloneId, substAndCloneIds, lookupIdSubst
)
import Type ( mkFunTys, splitFunTys, splitAlgTyConApp_maybe,
isUnLiftedType, isTyVarTy, splitForAllTys, Type
)
-import PprType ( {- instance Outputable Type -} )
import TyCon ( TyCon, isDataTyCon )
import Util ( zipEqual )
import Outputable
import PrimRep ( PrimRep(..) )
import Outputable
import Type ( Type )
-import PprType ( {- instance Outputable Type -} )
import UniqSet ( isEmptyUniqSet, uniqSetToList, UniqSet )
\end{code}
mkPredTy, splitRhoTy, mkForAllTy, isUnLiftedType,
isUnboxedType, unboxedTypeKind, boxedTypeKind
)
-import PprType ( {- instance Outputable Type -} )
import FunDeps ( tyVarFunDep, oclose )
import Var ( TyVar, tyVarKind )
import VarSet
mkSigmaTy, mkForAllTys, mkClassPred, classesOfPreds,
boxedTypeKind, mkArrowKind
)
-import PprType ( {- instance Outputable Type -} )
import Var ( tyVarKind, TyVar )
import VarSet ( mkVarSet, emptyVarSet )
import TyCon ( mkAlgTyCon )
mkSigmaTy, mkDictTy, isUnboxedType,
splitAlgTyConApp, classesToPreds
)
-import PprType ( {- instance Outputable Type -} )
import TysWiredIn ( voidTy )
import Var ( TyVar )
import Unique -- Keys stuff
, isForAllTy
, mkForAllTys
)
-import PprType ( {- instance Outputable Type -} )
import TysWiredIn ( isFFIArgumentTy, isFFIResultTy,
isFFIExternalTy, isAddrTy
import RnHsSyn ( RenamedPat, RenamedArithSeqInfo, RenamedHsExpr )
import Type ( Type, Kind, PredType, ThetaType, RhoType, TauType,
)
-import PprType ( {- instance Outputable Type -} )
import ErrUtils ( addShortErrLocLine, addShortWarnLocLine, pprBagOfErrors, ErrMsg, Message, WarnMsg )
import CmdLineOpts ( opt_PprStyle_Debug )
)
import Id ( Id, idType, isDataConWrapId_maybe )
import Type ( Type, isTauTy, mkTyConApp, mkClassPred, boxedTypeKind )
-import PprType ( {- instance Outputable Type -} )
import Subst ( substTy, substClasses )
import TysPrim ( charPrimTy, intPrimTy, floatPrimTy,
doublePrimTy, addrPrimTy
import Type ( typeKind, tyVarsOfType, splitAppTy_maybe
)
+import PprType () -- Instances
+ -- This import isn't strictly necessary, but it makes sure that
+ -- PprType is below Unify in the hierarchy, which in turn makes
+ -- fewer modules boot-import PprType
+
import Var ( TyVar, tyVarKind )
import VarSet
import VarEnv ( TyVarSubstEnv, emptySubstEnv, lookupSubstEnv, extendSubstEnv,