Improvements to record puns, wildcards
authorsimonpj@microsoft.com <unknown>
Thu, 20 Aug 2009 12:34:43 +0000 (12:34 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 20 Aug 2009 12:34:43 +0000 (12:34 +0000)
commitd64022dc071b587c20a693b7f355f69dc110b707
tree4de5684a83ab0e0fb97eff8493c77c2525afc700
parent4a84e214da8a2d87d2fd819d59fb06115e98014c
Improvements to record puns, wildcards

* Make C { A.a } work with punning, expanding to C { A.a = a }

* Make it so that, with -fwarn-unused-matches,
        f (C {..}) = x
  does not complain about the bindings introduced by the "..".

* Make -XRecordWildCards implies -XDisambiguateRecordFields.

* Overall refactoring of RnPat, which had become very crufty.
  In particular, there is now a monad, CpsRn, private to RnPat,
  which deals with the cps-style plumbing.  This is why so many
  lines of RnPat have changed.

* Refactor the treatment of renaming of record fields into two passes
- rnHsRecFields1, used both for patterns and expressions,
     which expands puns, wild-cards
   - a local renamer in RnPat for fields in patterns
- a local renamer in RnExpr for fields in construction and update
  This make it all MUCH easier to understand

* Improve documentation of record puns, wildcards, and disambiguation
12 files changed:
compiler/basicTypes/RdrName.lhs
compiler/main/DynFlags.hs
compiler/parser/RdrHsSyn.lhs
compiler/rename/RnBinds.lhs
compiler/rename/RnEnv.lhs
compiler/rename/RnExpr.lhs
compiler/rename/RnPat.lhs
compiler/rename/RnSource.lhs
compiler/rename/RnTypes.lhs
compiler/typecheck/TcEnv.lhs
compiler/typecheck/TcPat.lhs
docs/users_guide/glasgow_exts.xml