[project @ 2001-05-08 14:44:37 by simonpj]
authorsimonpj <unknown>
Tue, 8 May 2001 14:44:38 +0000 (14:44 +0000)
committersimonpj <unknown>
Tue, 8 May 2001 14:44:38 +0000 (14:44 +0000)
commit7c72bad588294734ecf3590247c67e47f8ba63fd
tree2093f786d0c269c9f95082c62b64ff1277481f8c
parent76573a24b556f35ec9177397f4f574b0fd0af245
[project @ 2001-05-08 14:44:37 by simonpj]
**** MERGE WITH 5.00 BRANCH     ********

--------------------------------------
Make parallel list comprehensions work
--------------------------------------

There were two bugs

1.  The desugaring in DsListComp was generating code that failed Lint.
    I've restructured it quite a lot.

2.  More seriously, in a ParStmt, the last 'stmt' may be a guard;
    but previously both guards and the result of a list comprehension
    were encoded as an ExprStmt (see HsExpr.Stmt), using the fact that
    the stmt was last in the list to make the difference between a guard
    and a result.  But in parallel list comp this isn't right:

[ e | x <- xs, guard | y <- ys ]

    Here 'guard' is last in its list, but isn't an overall result.

    The sensible fix is to properly distinguish
"here's the answer"   (ResultStmt)
"here's a guard or an imperative action" (ExprStmt)

    The fix is rather easy, but touched quite a lot of files.  On the
    way I tidied up the parser a little.
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsGRHSs.lhs
ghc/compiler/deSugar/DsListComp.lhs
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/hsSyn/HsMatches.lhs [deleted file]
ghc/compiler/parser/Parser.y
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/typecheck/TcGenDeriv.lhs
ghc/compiler/typecheck/TcHsSyn.lhs
ghc/compiler/typecheck/TcMatches.lhs
ghc/compiler/typecheck/TcModule.lhs