[project @ 2001-04-10 22:34:47 by lewie]
authorlewie <unknown>
Tue, 10 Apr 2001 22:34:47 +0000 (22:34 +0000)
committerlewie <unknown>
Tue, 10 Apr 2001 22:34:47 +0000 (22:34 +0000)
Don't use foldr/build if we've got a parallel list comp.  We'd need to
have/generate a family of functions foldr{2,3,...} to do anything nicer here.

ghc/compiler/deSugar/DsListComp.lhs

index 431fb93..337535d 100644 (file)
@@ -44,7 +44,8 @@ dsListComp :: [TypecheckedStmt]
           -> DsM CoreExpr
 
 dsListComp quals elt_ty
-  | not opt_FoldrBuildOn                -- Be boring
+  |  not opt_FoldrBuildOn               -- Be boring
+  || isParallelComp quals
   = deListComp quals (mkNilExpr elt_ty)
 
   | otherwise                           -- foldr/build lives!
@@ -58,6 +59,9 @@ dsListComp quals elt_ty
     dsLookupGlobalValue buildName      `thenDs` \ build_id ->
     returnDs (Var build_id `App` Type elt_ty 
                           `App` mkLams [n_tyvar, c, n] result)
+
+  where isParallelComp (ParStmtOut bndrstmtss : _) = True
+       isParallelComp _                           = False
 \end{code}
 
 %************************************************************************