summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsListComp.lhs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-12-10 08:45:30 +0000
committersimonpj@microsoft.com <unknown>2010-12-10 08:45:30 +0000
commit7836349556deef66f1b1d06fe8e9c7c0b841f0d0 (patch)
treee7dc787616490fefc20e039f365dabc8efe4f0b6 /compiler/deSugar/DsListComp.lhs
parent3e09edbc9e9c2bd8b0fddc946ce28014881cbfa1 (diff)
downloadhaskell-7836349556deef66f1b1d06fe8e9c7c0b841f0d0.tar.gz
Fix Trac #4534: renamer bug
The renamer wasn't attaching the right used-variables to a TransformStmt constructor. The real modification is in RnExpr; the rest is just pretty-printing and white space.
Diffstat (limited to 'compiler/deSugar/DsListComp.lhs')
-rw-r--r--compiler/deSugar/DsListComp.lhs17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/deSugar/DsListComp.lhs b/compiler/deSugar/DsListComp.lhs
index 166bfc244c..2292aedc12 100644
--- a/compiler/deSugar/DsListComp.lhs
+++ b/compiler/deSugar/DsListComp.lhs
@@ -92,12 +92,12 @@ dsInnerListComp (stmts, bndrs) = do
-- Given such a statement it gives you back an expression representing how to compute the transformed
-- list and the tuple that you need to bind from that list in order to proceed with your desugaring
dsTransformStmt :: Stmt Id -> DsM (CoreExpr, LPat Id)
-dsTransformStmt (TransformStmt stmts binders usingExpr maybeByExpr) = do
- (expr, binders_tuple_type) <- dsInnerListComp (stmts, binders)
- usingExpr' <- dsLExpr usingExpr
+dsTransformStmt (TransformStmt stmts binders usingExpr maybeByExpr)
+ = do { (expr, binders_tuple_type) <- dsInnerListComp (stmts, binders)
+ ; usingExpr' <- dsLExpr usingExpr
- using_args <-
- case maybeByExpr of
+ ; using_args <-
+ case maybeByExpr of
Nothing -> return [expr]
Just byExpr -> do
byExpr' <- dsLExpr byExpr
@@ -108,10 +108,9 @@ dsTransformStmt (TransformStmt stmts binders usingExpr maybeByExpr) = do
return [Lam tuple_binder byExprWrapper, expr]
- let inner_list_expr = mkApps usingExpr' ((Type binders_tuple_type) : using_args)
-
- let pat = mkBigLHsVarPatTup binders
- return (inner_list_expr, pat)
+ ; let inner_list_expr = mkApps usingExpr' ((Type binders_tuple_type) : using_args)
+ pat = mkBigLHsVarPatTup binders
+ ; return (inner_list_expr, pat) }
-- This function factors out commonality between the desugaring strategies for GroupStmt.
-- Given such a statement it gives you back an expression representing how to compute the transformed