X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcMatches.lhs;h=f912039be7282ddd9a350938738e8f5735a4dbfa;hb=db4f42a8e38bfead11f5af78557e18b9f42b10b3;hp=24533608cc1817b36495d21ae1668c19eedb72e6;hpb=27310213397bb89555bb03585e057ba1b017e895;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcMatches.lhs b/compiler/typecheck/TcMatches.lhs index 2453360..f912039 100644 --- a/compiler/typecheck/TcMatches.lhs +++ b/compiler/typecheck/TcMatches.lhs @@ -28,7 +28,7 @@ import TysWiredIn import Id import TyCon import TysPrim -import Coercion ( mkSymCoI ) +import Coercion ( mkSymCo ) import Outputable import BasicTypes ( Arity ) import Util @@ -104,15 +104,15 @@ tcMatchesCase ctxt scrut_ty matches res_ty tcMatchLambda :: MatchGroup Name -> TcRhoType -> TcM (HsWrapper, MatchGroup TcId) tcMatchLambda match res_ty - = matchFunTys doc n_pats res_ty $ \ pat_tys rhs_ty -> + = matchFunTys herald n_pats res_ty $ \ pat_tys rhs_ty -> tcMatches match_ctxt pat_tys rhs_ty match where n_pats = matchGroupArity match - doc = sep [ ptext (sLit "The lambda expression") - <+> quotes (pprSetDepth (PartWay 1) $ + herald = sep [ ptext (sLit "The lambda expression") + <+> quotes (pprSetDepth (PartWay 1) $ pprMatches (LambdaExpr :: HsMatchContext Name) match), -- The pprSetDepth makes the abstraction print briefly - ptext (sLit "has") <+> speakNOf n_pats (ptext (sLit "argument"))] + ptext (sLit "has")] match_ctxt = MC { mc_what = LambdaExpr, mc_body = tcBody } \end{code} @@ -143,7 +143,7 @@ matchFunTys matchFunTys herald arity res_ty thing_inside = do { (coi, pat_tys, res_ty) <- matchExpectedFunTys herald arity res_ty ; res <- thing_inside pat_tys res_ty - ; return (coiToHsWrapper (mkSymCoI coi), res) } + ; return (coToHsWrapper (mkSymCo coi), res) } \end{code} %************************************************************************ @@ -246,7 +246,7 @@ tcDoStmts ListComp stmts body res_ty ; (stmts', body') <- tcStmts ListComp (tcLcStmt listTyCon) stmts elt_ty $ tcBody body - ; return $ mkHsWrapCoI coi + ; return $ mkHsWrapCo coi (HsDo ListComp stmts' body' (mkListTy elt_ty)) } tcDoStmts PArrComp stmts body res_ty @@ -254,7 +254,7 @@ tcDoStmts PArrComp stmts body res_ty ; (stmts', body') <- tcStmts PArrComp (tcLcStmt parrTyCon) stmts elt_ty $ tcBody body - ; return $ mkHsWrapCoI coi + ; return $ mkHsWrapCo coi (HsDo PArrComp stmts' body' (mkPArrTy elt_ty)) } tcDoStmts DoExpr stmts body res_ty