[commit: ghc] master: Fix Trac #8186. (382f601)

git at git.haskell.org git at git.haskell.org
Wed Aug 28 05:06:40 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/382f601406b11b7d4fdc72d773c6060372f1fbb3/ghc

>---------------------------------------------------------------

commit 382f601406b11b7d4fdc72d773c6060372f1fbb3
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Tue Aug 27 17:39:08 2013 -0400

    Fix Trac #8186.
    
    Parallel list comprehensions are now handled in DsMeta.


>---------------------------------------------------------------

382f601406b11b7d4fdc72d773c6060372f1fbb3
 compiler/deSugar/DsMeta.hs |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 7a8fd2d..218b00e 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -1127,6 +1127,19 @@ repSts (BodyStmt e _ _ _ : ss) =
       ; z <- repNoBindSt e2
       ; (ss2,zs) <- repSts ss
       ; return (ss2, z : zs) }
+repSts (ParStmt stmt_blocks _ _ : ss) =
+   do { (ss_s, stmt_blocks1) <- mapAndUnzipM rep_stmt_block stmt_blocks
+      ; let stmt_blocks2 = nonEmptyCoreList stmt_blocks1
+            ss1 = concat ss_s
+      ; z <- repParSt stmt_blocks2
+      ; (ss2, zs) <- addBinds ss1 (repSts ss)
+      ; return (ss1++ss2, z : zs) }
+   where
+     rep_stmt_block :: ParStmtBlock Name Name -> DsM ([GenSymBind], Core [TH.StmtQ])
+     rep_stmt_block (ParStmtBlock stmts _ _) =
+       do { (ss1, zs) <- repSts (map unLoc stmts)
+          ; zs1 <- coreList stmtQTyConName zs
+          ; return (ss1, zs1) }
 repSts [LastStmt e _]
   = do { e2 <- repLE e
        ; z <- repNoBindSt e2
@@ -1618,6 +1631,9 @@ repLetSt (MkC ds) = rep2 letSName [ds]
 repNoBindSt :: Core TH.ExpQ -> DsM (Core TH.StmtQ)
 repNoBindSt (MkC e) = rep2 noBindSName [e]
 
+repParSt :: Core [[TH.StmtQ]] -> DsM (Core TH.StmtQ)
+repParSt (MkC sss) = rep2 parSName [sss]
+
 -------------- Range (Arithmetic sequences) -----------
 repFrom :: Core TH.ExpQ -> DsM (Core TH.ExpQ)
 repFrom (MkC x) = rep2 fromEName [x]





More information about the ghc-commits mailing list