X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcHsSyn.lhs;h=9ae0022de59de675cdb6a08d0f49503a0afb6450;hb=9c848a68f7b05aa352cd97d9a75488d20a774736;hp=9dc5fcafce8701b98794b08e743b12c51e3d9ef3;hpb=064a65d90058bbb5f48e311649a1211a32ad891d;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcHsSyn.lhs b/ghc/compiler/typecheck/TcHsSyn.lhs index 9dc5fca..9ae0022 100644 --- a/ghc/compiler/typecheck/TcHsSyn.lhs +++ b/ghc/compiler/typecheck/TcHsSyn.lhs @@ -24,12 +24,11 @@ module TcHsSyn ( mkHsTyApp, mkHsDictApp, mkHsConApp, mkHsTyLam, mkHsDictLam, mkHsLet, - idsToMonoBinds, -- re-exported from TcEnv - TcId, tcInstId, + TcId, - zonkTopBinds, zonkId, zonkIdOcc, + zonkTopBinds, zonkId, zonkIdOcc, zonkExpr, zonkForeignExports, zonkRules ) where @@ -39,18 +38,16 @@ module TcHsSyn ( import HsSyn -- oodles of it -- others: -import Id ( idName, idType, idUnfolding, setIdType, omitIfaceSigForId, isIP, Id ) +import Id ( idName, idType, isLocalId, setIdType, isIP, Id ) import DataCon ( dataConWrapId ) import TcEnv ( tcLookupGlobal_maybe, tcExtendGlobalValEnv, - TcEnv, TcId, tcInstId + TcEnv, TcId ) import TcMonad import TcType ( zonkTcTypeToType, zonkTcTyVarToTyVar, zonkTcType, zonkTcSigTyVars ) -import Name ( isLocallyDefined ) import CoreSyn ( Expr ) -import CoreUnfold( unfoldingTemplate ) import BasicTypes ( RecFlag(..) ) import Bag import Outputable @@ -119,12 +116,6 @@ mkHsLet EmptyMonoBinds expr = expr mkHsLet mbinds expr = HsLet (MonoBind mbinds [] Recursive) expr mkHsConApp data_con tys args = foldl HsApp (HsVar (dataConWrapId data_con) `mkHsTyApp` tys) args - -idsToMonoBinds :: [Id] -> TcMonoBinds -idsToMonoBinds ids - = andMonoBindList [ CoreMonoBind id (unfoldingTemplate (idUnfolding id)) - | id <- ids - ] \end{code} %************************************************************************ @@ -165,9 +156,8 @@ zonkIdBndr id zonkIdOcc :: TcId -> NF_TcM Id zonkIdOcc id - | not (isLocallyDefined id) || omitIfaceSigForId id || isIP id - -- The omitIfaceSigForId thing may look wierd but it's quite - -- sensible really. We're avoiding looking up superclass selectors + | not (isLocalId id) || isIP id + -- We're avoiding looking up superclass selectors -- and constructors; zonking them is a no-op anyway, and the -- superclass selectors aren't in the environment anyway. = returnNF_Tc id @@ -176,7 +166,7 @@ zonkIdOcc id let new_id = case maybe_id' of Just (AnId id') -> id' - other -> pprTrace "zonkIdOcc: " (ppr id) id + other -> pprTrace "zonkIdOcc:" (ppr id) id in returnNF_Tc new_id \end{code} @@ -510,6 +500,15 @@ zonkStmts :: [TcStmt] zonkStmts [] = returnNF_Tc [] +zonkStmts (ParStmtOut bndrstmtss : stmts) + = mapNF_Tc (mapNF_Tc zonkId) bndrss `thenNF_Tc` \ new_bndrss -> + let new_binders = concat new_bndrss in + mapNF_Tc zonkStmts stmtss `thenNF_Tc` \ new_stmtss -> + tcExtendGlobalValEnv new_binders $ + zonkStmts stmts `thenNF_Tc` \ new_stmts -> + returnNF_Tc (ParStmtOut (zip new_bndrss new_stmtss) : new_stmts) + where (bndrss, stmtss) = unzip bndrstmtss + zonkStmts [ReturnStmt expr] = zonkExpr expr `thenNF_Tc` \ new_expr -> returnNF_Tc [ReturnStmt new_expr]