From: lewie Date: Tue, 10 Apr 2001 22:34:47 +0000 (+0000) Subject: [project @ 2001-04-10 22:34:47 by lewie] X-Git-Tag: Approximately_9120_patches~2171 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=54cbdfde8ff2073adebea3199efffa79367571ef;p=ghc-hetmet.git [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. --- 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} %************************************************************************