X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FMatch.lhs;h=a28eb844bdd1798ca5515086735f53e8a1dba3c3;hb=f5baf549bcd4b835fdc8e0ce00b854f522464e68;hp=f545930a48c44826faf1a38aaf5de112a27d880d;hpb=860e92c1dd65f2a7a617c253849d7ce84ed9bbc9;p=ghc-hetmet.git diff --git a/compiler/deSugar/Match.lhs b/compiler/deSugar/Match.lhs index f545930..a28eb84 100644 --- a/compiler/deSugar/Match.lhs +++ b/compiler/deSugar/Match.lhs @@ -26,6 +26,7 @@ import Check import CoreSyn import Literal import CoreUtils +import MkCore import DsMonad import DsBinds import DsGRHSs @@ -242,7 +243,7 @@ Make all constructor patterns in column~1 into @ConPats@, notably Handle any irrefutable (or ``twiddle'') @LazyPats@. \end{itemize} \item -Now {\em unmix} the equations into {\em blocks} [w/ local function +Now {\em unmix} the equations into {\em blocks} [w\/ local function @unmix_eqns@], in which the equations in a block all have variable patterns in column~1, or they all have constructor patterns in ... (see ``the mixture rule'' in SLPJ). @@ -268,7 +269,7 @@ Wadler-chapter @match@ (p.~93, last clause), and @match_unmixed_blk@ corresponds roughly to @matchVarCon@. \begin{code} -match :: [Id] -- Variables rep'ing the exprs we're matching with +match :: [Id] -- Variables rep\'ing the exprs we\'re matching with -> Type -- Type of the case expression -> [EquationInfo] -- Info about patterns, etc. (type synonym below) -> DsM MatchResult -- Desugared result! @@ -462,7 +463,7 @@ tidy1 v (VarPat var) tidy1 v (VarPatOut var binds) = do { prs <- dsLHsBinds binds - ; return (wrapBind var v . mkDsLet (Rec prs), + ; return (wrapBind var v . mkCoreLet (Rec prs), WildPat (idType var)) } -- case v of { x@p -> mr[] } @@ -485,7 +486,7 @@ tidy1 v (AsPat (L _ var) pat) tidy1 v (LazyPat pat) = do { sel_prs <- mkSelectorBinds pat (Var v) ; let sel_binds = [NonRec b rhs | (b,rhs) <- sel_prs] - ; return (mkDsLets sel_binds, WildPat (idType v)) } + ; return (mkCoreLets sel_binds, WildPat (idType v)) } tidy1 _ (ListPat pats ty) = return (idDsWrapper, unLoc list_ConPat)