import Inst ( showLIE )
import TcBinds ( tcTopBinds )
import TcDefaults ( tcDefaults )
-import TcEnv ( tcExtendGlobalValEnv, tcLookupGlobal )
+import TcEnv ( tcExtendGlobalValEnv )
import TcRules ( tcRules )
import TcForeign ( tcForeignImports, tcForeignExports )
import TcInstDcls ( tcInstDecls1, tcInstDecls2 )
import HscTypes ( ModGuts(..), HscEnv(..),
GhciMode(..), noDependencies,
Deprecs( NoDeprecs ), plusDeprecs,
- GenAvailInfo(Avail), availsToNameSet, availName,
ForeignStubs(NoStubs), TypeEnv, typeEnvTyCons,
extendTypeEnvWithIds, typeEnvIds, typeEnvTyCons,
emptyFixityEnv
import TcMatches ( tcStmtsAndThen, TcStmtCtxt(..) )
import TcSimplify ( tcSimplifyInteractive, tcSimplifyInfer )
import TcType ( Type, mkForAllTys, mkFunTys, mkTyConApp, tyVarsOfType )
-import TcEnv ( tcLookupTyCon, tcLookupId )
-import TyCon ( DataConDetails(..) )
+import TcEnv ( tcLookupTyCon, tcLookupId, tcLookupGlobal )
import Inst ( tcStdSyntaxName )
import RnExpr ( rnStmts, rnLExpr )
import RnNames ( exportsToAvails )
import LoadIface ( loadSrcInterface )
-import IfaceSyn ( IfaceDecl(..), IfaceClassOp(..), IfaceConDecl(..), IfaceExtName(..),
+import IfaceSyn ( IfaceDecl(..), IfaceClassOp(..), IfaceConDecl(..),
+ IfaceExtName(..), IfaceConDecls(..),
tyThingToIfaceDecl )
import RnEnv ( lookupOccRn, dataTcOccs, lookupFixityRn )
import Id ( Id, isImplicitId )
import Module ( ModuleName, lookupModuleEnvByName )
import HscTypes ( InteractiveContext(..),
HomeModInfo(..), typeEnvElts,
- TyThing(..), availNames, icPrintUnqual,
+ TyThing(..), availName, availNames, icPrintUnqual,
ModIface(..), ModDetails(..) )
import BasicTypes ( RecFlag(..), Fixity )
import Bag ( unitBag )
-- a list of the bound values, coerced to ().
tcRnStmt hsc_env ictxt rdr_stmt
- = initTc hsc_env iNTERACTIVE $
+ = initTcPrintErrors hsc_env iNTERACTIVE $
setInteractiveContext ictxt $ do {
-- Rename; use CmdLineMode because tcRnStmt is only used interactively
-> LHsExpr RdrName
-> IO (Maybe Type)
tcRnExpr hsc_env ictxt rdr_expr
- = initTc hsc_env iNTERACTIVE $
+ = initTcPrintErrors hsc_env iNTERACTIVE $
setInteractiveContext ictxt $ do {
(rn_expr, fvs) <- rnLExpr rdr_expr ;
-- *and* as a type or class constructor;
-- hence the call to dataTcOccs, and we return up to two results
tcRnThing hsc_env ictxt rdr_name
- = initTc hsc_env iNTERACTIVE $
+ = initTcPrintErrors hsc_env iNTERACTIVE $
setInteractiveContext ictxt $ do {
-- If the identifier is a constructor (begins with an
-> IO GlobalRdrEnv
mkExportEnv hsc_env exports
- = do { mb_envs <- initTc hsc_env iNTERACTIVE $
+ = do { mb_envs <- initTcPrintErrors hsc_env iNTERACTIVE $
mappM getModuleExports exports
; case mb_envs of
Just envs -> return (foldr plusGlobalRdrEnv emptyGlobalRdrEnv envs)
-> IO (Maybe [IfaceDecl])
getModuleContents hsc_env ictxt mod exports_only
- = initTc hsc_env iNTERACTIVE (get_mod_contents exports_only)
+ = initTcPrintErrors hsc_env iNTERACTIVE (get_mod_contents exports_only)
where
get_mod_contents exports_only
| not exports_only -- We want the whole top-level type env
---------------------
filter_decl occs decl@(IfaceClass {ifSigs = sigs})
= decl { ifSigs = filter (keep_sig occs) sigs }
-filter_decl occs decl@(IfaceData {ifCons = DataCons cons})
- = decl { ifCons = DataCons (filter (keep_con occs) cons) }
+filter_decl occs decl@(IfaceData {ifCons = IfDataTyCon cons})
+ = decl { ifCons = IfDataTyCon (filter (keep_con occs) cons) }
+filter_decl occs decl@(IfaceData {ifCons = IfNewTyCon con})
+ | keep_con occs con = decl
+ | otherwise = decl {ifCons = IfAbstractTyCon} -- Hmm?
filter_decl occs decl
= decl