Thu Mar 4 04:53:37 PST 2010 [email protected]
* Refactor part of the renamer to fix Trac #3901
This one was bigger than I anticipated! The problem was that were
were gathering the binders from a pattern before renaming -- but with
record wild-cards we don't know what variables are bound by C {..}
until after the renamer has filled in the "..".
So this patch does the following
* Change all the collect-X-Binders functions in HsUtils so that
they expect to only be called *after* renaming. That means they
don't need to return [Located id] but just [id]. Which turned out
to be a very worthwhile simplification all by itself.
* Refactor the renamer, and in ptic RnExpr.rnStmt, so that it
doesn't need to use collectLStmtsBinders on pre-renamed Stmts.
* This in turn required me to understand how GroupStmt and
TransformStmts were renamed. Quite fiddly. I rewrote most of it;
result is much shorter.
* In doing so I flattened HsExpr.GroupByClause into its parent
GroupStmt, with trivial knock-on effects in other files.
Blargh.
M ./compiler/deSugar/Coverage.lhs -20 +17
M ./compiler/deSugar/DsArrows.lhs -22 +18
M ./compiler/deSugar/DsListComp.lhs -25 +19
M ./compiler/deSugar/DsMeta.hs -6 +6
M ./compiler/hsSyn/HsExpr.lhs -38 +65
M ./compiler/hsSyn/HsPat.lhs -1 +1
M ./compiler/hsSyn/HsUtils.lhs -102 +142
M ./compiler/rename/RnBinds.lhs -3 +3
M ./compiler/rename/RnEnv.lhs -2 +10
M ./compiler/rename/RnExpr.lhs -151 +119
M ./compiler/rename/RnPat.lhs -1 +2
M ./compiler/rename/RnSource.lhs -3 +3
M ./compiler/typecheck/TcBinds.lhs -1 +1
M ./compiler/typecheck/TcDeriv.lhs -1 +1
M ./compiler/typecheck/TcHsSyn.lhs -19 +8
M ./compiler/typecheck/TcMatches.lhs -36 +37
M ./compiler/typecheck/TcRnDriver.lhs -2 +2
View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20100304125337-1287e-2250a676ef419ab5dc9c49631576eb460492a2d3.gz
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc