X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FDsUtils.lhs;h=29e7773bb8c49bdc0838970314fd51999aa00ed4;hb=3c245de9199f522f75ace92219256badbd928bd6;hp=70944f81591b24ff0acf836754702afa72de9a03;hpb=04feba252e40d16101b92948cd1e13c7bc1f3062;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/DsUtils.lhs b/ghc/compiler/deSugar/DsUtils.lhs index 70944f8..29e7773 100644 --- a/ghc/compiler/deSugar/DsUtils.lhs +++ b/ghc/compiler/deSugar/DsUtils.lhs @@ -27,11 +27,11 @@ module DsUtils ( mkSelectorBinds, mkTupleExpr, mkTupleSelector, mkTupleType, mkTupleCase, mkBigCoreTup, - mkCoreTup, mkCoreTupTy, + mkCoreTup, mkCoreTupTy, seqVar, dsSyntaxTable, lookupEvidence, - selectSimpleMatchVarL, selectMatchVars + selectSimpleMatchVarL, selectMatchVars, selectMatchVar ) where #include "HsVersions.h" @@ -169,6 +169,7 @@ selectMatchVars (p:ps) (ty:tys) = do { v <- selectMatchVar p ty ; vs <- selectMatchVars ps tys ; return (v:vs) } +selectMatchVar (BangPat pat) pat_ty = selectMatchVar (unLoc pat) pat_ty selectMatchVar (LazyPat pat) pat_ty = selectMatchVar (unLoc pat) pat_ty selectMatchVar (VarPat var) pat_ty = try_for var pat_ty selectMatchVar (AsPat var pat) pat_ty = try_for (unLoc var) pat_ty @@ -255,6 +256,10 @@ wrapBind new old body | isTyVar new = App (Lam new body) (Type (mkTyVarTy old)) | otherwise = Let (NonRec new (Var old)) body +seqVar :: Var -> CoreExpr -> CoreExpr +seqVar var body = Case (Var var) var (exprType body) + [(DEFAULT, [], body)] + mkCoLetMatchResult :: CoreBind -> MatchResult -> MatchResult mkCoLetMatchResult bind match_result = adjustMatchResult (mkDsLet bind) match_result