From 54cbdfde8ff2073adebea3199efffa79367571ef Mon Sep 17 00:00:00 2001 From: lewie Date: Tue, 10 Apr 2001 22:34:47 +0000 Subject: [PATCH] [project @ 2001-04-10 22:34:47 by lewie] 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/deSugar/DsListComp.lhs b/ghc/compiler/deSugar/DsListComp.lhs index 431fb93..337535d 100644 --- a/ghc/compiler/deSugar/DsListComp.lhs +++ b/ghc/compiler/deSugar/DsListComp.lhs @@ -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} %************************************************************************ -- 1.7.10.4