summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2013-08-27 17:39:08 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2013-08-27 23:04:58 -0400
commit382f601406b11b7d4fdc72d773c6060372f1fbb3 (patch)
tree26bebee9feee3010b895213bdd967ea80f97d377 /compiler/deSugar
parent728bd07065425519e74bae2fc464e6c0d23f6952 (diff)
downloadhaskell-382f601406b11b7d4fdc72d773c6060372f1fbb3.tar.gz
Fix Trac #8186.
Parallel list comprehensions are now handled in DsMeta.
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/DsMeta.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 7a8fd2da70..218b00e8d0 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]