<commit_before>s%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
\section[TcModule]{Typechecking a whole module}

\begin{code}
module TcRnDriver (
#ifdef GHCI
	mkExportEnv, getModuleContents, tcRnStmt, 
	tcRnGetInfo, tcRnExpr, tcRnType,
#endif
	tcRnModule, 
	tcTopSrcDecls,
	tcRnExtCore
    ) where

#include "HsVersions.h"

#ifdef GHCI
import {-# SOURCE #-} TcSplice ( tcSpliceDecls )
#endif

import CmdLineOpts	( DynFlag(..), opt_PprStyle_Debug, dopt )
import Packages		( moduleToPackageConfig, mkPackageId, package,
			  isHomeModule )
import DriverState	( v_MainModIs, v_MainFunIs )
import HsSyn		( HsModule(..), HsExtCore(..), HsGroup(..), LHsDecl, SpliceDecl(..), HsBind(..),
			  nlHsApp, nlHsVar, pprLHsBinds )
import RdrHsSyn		( findSplice )

import PrelNames	( runIOName, rootMainName, mAIN,
			  main_RDR_Unqual )
import RdrName		( RdrName, mkRdrUnqual, emptyGlobalRdrEnv, 
			  plusGlobalRdrEnv )
import TcHsSyn		( zonkTopDecls )
import TcExpr 		( tcInferRho )
import TcRnMonad
import TcType		( tidyTopType, tcEqType, mkTyVarTys, substTyWith )
import Inst		( showLIE )
import TcBinds		( tcTopBinds )
import TcDefaults	( tcDefaults )
import TcEnv		( tcExtendGlobalValEnv )
import TcRules		( tcRules )
import TcForeign	( tcForeignImports, tcForeignExports )
import TcInstDcls	( tcInstDecls1, tcInstDecls2 )
import TcIface		( tcExtCoreBindings )
import TcSimplify	( tcSimplifyTop )
import TcTyClsDecls	( tcTyAndClassDecls )
import LoadIface	( loadOrphanModules, loadHiBootInterface )
import RnNames		( importsFromLocalDecls, rnImports, exportsFromAvail,
			  reportUnusedNames, reportDeprecations )
import RnEnv		( lookupSrcOcc_maybe )
import RnSource		( rnSrcDecls, rnTyClDecls, checkModDeprec )
import PprCore		( pprIdRules, pprCoreBindings )
import CoreSyn		( IdCoreRule, bindersOfBinds )
import DataCon		( dataConWrapId )
import ErrUtils		( Messages, mkDumpDoc, showPass )
import Id		( mkExportedLocalId, isLocalId, idName, idType )
import Var		( Var )
import Module           ( mkModule, moduleEnvElts )
import OccName		( mkVarOcc )
import Name		( Name, isExternalName, getSrcLoc, getOccName )
import NameSet
import TyCon		( tyConHasGenerics, isSynTyCon, getSynTyConDefn, tyConKind )
import SrcLoc		( srcLocSpan, Located(..), noLoc )
import Outputable
import HscTypes		( ModGuts(..), HscEnv(..), ExternalPackageState(..),
			  GhciMode(..), noDependencies, 
			  Deprecs( NoDeprecs ), plusDeprecs,
			  ForeignStubs(NoStubs), TyThing(..), 
			  TypeEnv, lookupTypeEnv,
			  extendTypeEnvWithIds, typeEnvIds, typeEnvTyCons, 
			  emptyFixityEnv
			)
#ifdef GHCI
import HsSyn		( HsStmtContext(..), Stmt(..), HsExpr(..), HsBindGroup(..), 
			  LStmt, LHsExpr, LHsType, mkMatchGroup,
			  collectStmtsBinders, mkSimpleMatch, 
			  nlLetStmt, nlExprStmt, nlBindStmt, nlResultStmt, nlVarPat )
import RdrName		( GlobalRdrEnv, mkGlobalRdrEnv, GlobalRdrElt(..),
			  Provenance(..), ImportSpec(..),
			  lookupLocalRdrEnv, extendLocalRdrEnv )
import RnSource		( addTcgDUs )
import TcHsSyn		( mkHsLet, zonkTopLExpr, zonkTopBndrs )
import TcHsType		( kcHsType )
import TcExpr		( tcCheckRho )
import TcIface		( loadImportedInsts )
import TcMType		( zonkTcType, zonkQuantifiedTyVar )
import TcUnify		( unifyTyConApp )
import TcMatches	( tcStmtsAndThen, TcStmtCtxt(..) )
import TcSimplify	( tcSimplifyInteractive, tcSimplifyInfer )
import TcType		( Type, mkForAllTys, mkFunTys, mkTyConApp, tyVarsOfType, 
			  isUnLiftedType, tyClsNamesOfDFunHead )
import TcEnv		( tcLookupTyCon, tcLookupId, tcLookupGlobal )
import RnTypes		( rnLHsType )
import Inst		( tcStdSyntaxName, tcGetInstEnvs )
import InstEnv		( DFunId, classInstances, instEnvElts )
import RnExpr		( rnStmts, rnLExpr )
import RnNames		( exportsToAvails )
import LoadIface	( loadSrcInterface )
import IfaceSyn		( IfaceDecl(..), IfaceClassOp(..), IfaceConDecl(..), 
			  IfaceExtName(..), IfaceConDecls(..), IfaceInst(..),
			  tyThingToIfaceDecl, dfunToIfaceInst )
import IfaceEnv		( lookupOrig )
import RnEnv		( lookupOccRn, dataTcOccs, lookupFixityRn )
import Id		( Id, isImplicitId, setIdType, globalIdDetails )
import MkId		( unsafeCoerceId )
import DataCon		( dataConTyCon )
import TyCon		( tyConName )
import TysWiredIn	( mkListTy, unitTy )
import IdInfo		( GlobalIdDetails(..) )
import SrcLoc		( interactiveSrcLoc, unLoc )
import Kind		( Kind )
import Var		( globaliseId )
import Name		( nameOccName, nameModule )
import NameEnv		( delListFromNameEnv )
import PrelNames	( iNTERACTIVE, ioTyConName, printName, monadNames, itName, returnIOName )
import Module		( Module, lookupModuleEnv )
import HscTypes		( InteractiveContext(..), HomeModInfo(..), typeEnvElts, typeEnvClasses,
			  availNames, availName, ModIface(..),
			  ModDetails(..), Dependencies(..) )
import BasicTypes	( RecFlag(..), Fixity )
import Bag		( unitBag )
import ListSetOps	( removeDups )
import Panic		( ghcError, GhcException(..) )
import SrcLoc		( SrcLoc )
#endif

import Util		( sortLe )
import Bag		( unionBags, snocBag )

import Maybe		( isJust )
\end{code}



%************************************************************************
%*									*<commit_msg>[project @ 2004-12-16 08:56:15 by simonpj] Darn!  Forgot this commit, which killed the nightly build<commit_after>s%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
\section[TcModule]{Typechecking a whole module}

\begin{code}
module TcRnDriver (
#ifdef GHCI
	mkExportEnv, getModuleContents, tcRnStmt, 
	tcRnGetInfo, tcRnExpr, tcRnType,
#endif
	tcRnModule, 
	tcTopSrcDecls,
	tcRnExtCore
    ) where

#include "HsVersions.h"

#ifdef GHCI
import {-# SOURCE #-} TcSplice ( tcSpliceDecls )
#endif

import CmdLineOpts	( DynFlag(..), opt_PprStyle_Debug, dopt )
import Packages		( moduleToPackageConfig, mkPackageId, package,
			  isHomeModule )
import DriverState	( v_MainModIs, v_MainFunIs )
import HsSyn		( HsModule(..), HsExtCore(..), HsGroup(..), LHsDecl, SpliceDecl(..), HsBind(..),
			  nlHsApp, nlHsVar, pprLHsBinds )
import RdrHsSyn		( findSplice )

import PrelNames	( runIOName, rootMainName, mAIN,
			  main_RDR_Unqual )
import RdrName		( RdrName, mkRdrUnqual, emptyGlobalRdrEnv, 
			  plusGlobalRdrEnv )
import TcHsSyn		( zonkTopDecls )
import TcExpr 		( tcInferRho )
import TcRnMonad
import TcType		( tidyTopType, tcEqType, mkTyVarTys, substTyWith )
import Inst		( showLIE )
import TcBinds		( tcTopBinds )
import TcDefaults	( tcDefaults )
import TcEnv		( tcExtendGlobalValEnv )
import TcRules		( tcRules )
import TcForeign	( tcForeignImports, tcForeignExports )
import TcInstDcls	( tcInstDecls1, tcInstDecls2 )
import TcIface		( tcExtCoreBindings )
import TcSimplify	( tcSimplifyTop )
import TcTyClsDecls	( tcTyAndClassDecls )
import LoadIface	( loadOrphanModules, loadHiBootInterface )
import RnNames		( importsFromLocalDecls, rnImports, exportsFromAvail,
			  reportUnusedNames, reportDeprecations )
import RnEnv		( lookupSrcOcc_maybe )
import RnSource		( rnSrcDecls, rnTyClDecls, checkModDeprec )
import PprCore		( pprIdRules, pprCoreBindings )
import CoreSyn		( IdCoreRule, bindersOfBinds )
import DataCon		( dataConWrapId )
import ErrUtils		( Messages, mkDumpDoc, showPass )
import Id		( mkExportedLocalId, isLocalId, idName, idType )
import Var		( Var )
import Module           ( mkModule, moduleEnvElts )
import OccName		( mkVarOcc )
import Name		( Name, isExternalName, getSrcLoc, getOccName )
import NameSet
import TyCon		( tyConHasGenerics, isSynTyCon, getSynTyConDefn, tyConKind )
import SrcLoc		( srcLocSpan, Located(..), noLoc )
import Outputable
import HscTypes		( ModGuts(..), HscEnv(..), ExternalPackageState(..),
			  GhciMode(..), noDependencies, 
			  Deprecs( NoDeprecs ), plusDeprecs,
			  ForeignStubs(NoStubs), TyThing(..), 
			  TypeEnv, lookupTypeEnv,
			  extendTypeEnvWithIds, typeEnvIds, typeEnvTyCons, 
			  emptyFixityEnv
			)
#ifdef GHCI
import HsSyn		( HsStmtContext(..), Stmt(..), HsExpr(..), HsBindGroup(..), 
			  LStmt, LHsExpr, LHsType, mkMatchGroup,
			  collectStmtsBinders, mkSimpleMatch, 
			  nlLetStmt, nlExprStmt, nlBindStmt, nlResultStmt, nlVarPat )
import RdrName		( GlobalRdrEnv, mkGlobalRdrEnv, GlobalRdrElt(..),
			  Provenance(..), ImportSpec(..),
			  lookupLocalRdrEnv, extendLocalRdrEnv )
import RnSource		( addTcgDUs )
import TcHsSyn		( mkHsLet, zonkTopLExpr, zonkTopBndrs )
import TcHsType		( kcHsType )
import TcExpr		( tcCheckRho )
import TcIface		( loadImportedInsts )
import TcMType		( zonkTcType, zonkQuantifiedTyVar )
import TcUnify		( unifyTyConApp )
import TcMatches	( tcStmtsAndThen, TcStmtCtxt(..) )
import TcSimplify	( tcSimplifyInteractive, tcSimplifyInfer )
import TcType		( Type, mkForAllTys, mkFunTys, mkTyConApp, tyVarsOfType, 
			  isUnLiftedType, tyClsNamesOfDFunHead )
import TcEnv		( tcLookupTyCon, tcLookupId, tcLookupGlobal )
import RnTypes		( rnLHsType )
import Inst		( tcStdSyntaxName, tcGetInstEnvs )
import InstEnv		( DFunId, classInstances, instEnvElts )
import RnExpr		( rnStmts, rnLExpr )
import RnNames		( exportsToAvails )
import LoadIface	( loadSrcInterface )
import IfaceSyn		( IfaceDecl(..), IfaceClassOp(..), IfaceConDecl(..), 
			  IfaceExtName(..), IfaceConDecls(..), IfaceInst(..),
			  tyThingToIfaceDecl, dfunToIfaceInst )
import IfaceEnv		( lookupOrig )
import RnEnv		( lookupOccRn, dataTcOccs, lookupFixityRn )
import Id		( Id, isImplicitId, setIdType, globalIdDetails )
import MkId		( unsafeCoerceId )
import DataCon		( dataConTyCon )
import TyCon		( tyConName )
import TysWiredIn	( mkListTy, unitTy )
import IdInfo		( GlobalIdDetails(..) )
import SrcLoc		( interactiveSrcLoc, unLoc )
import Kind		( Kind )
import Var		( globaliseId )
import Name		( nameOccName, nameModule )
import NameEnv		( delListFromNameEnv )
import PrelNames	( iNTERACTIVE, ioTyConName, printName, monadNames, itName, returnIOName )
import Module		( Module, lookupModuleEnv )
import HscTypes		( InteractiveContext(..), HomeModInfo(..), typeEnvElts, typeEnvClasses,
			  availNames, availName, ModIface(..),
			  ModDetails(..), Dependencies(..) )
import BasicTypes	( RecFlag(..), Fixity )
import Bag		( unitBag )
import ListSetOps	( removeDups )
import Panic		( ghcError, GhcException(..) )
import SrcLoc		( SrcLoc )
#endif

import FastString	( mkFastString )
import Util		( sortLe )
import Bag		( unionBags, snocBag )

import Maybe		( isJust )
\end{code}



%************************************************************************
%*									*
{'fraction_non_alphanumeric': 0.10888888888888888, 'fraction_numerical': 0.003285024154589372, 'mean_word_length': 4.773006134969325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '655419', 'n_tokens_mistral': 4168, 'n_tokens_neox': 3962, 'n_words': 854}