Another raft of Template Haskell clean-up
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 25 Nov 2013 16:58:28 +0000 (16:58 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 25 Nov 2013 16:58:43 +0000 (16:58 +0000)
commit51deeb0db3abac9f4369d3f8a3744e1313ecebf4
treefde7b556b53bdbf5f6f0adaecdd14e723acb27af
parentf8b25c30fe593a1195a4f4840b8773595dd0f2e0
Another raft of Template Haskell clean-up

The handling of typed and untyped brackets was extremely convoluted,
partly because of the evolutionary history.  I've tidied it all up.

See Note [How brackets and nested splices are handled] in TcSplice
for the full story

Main changes:

 * Untyped brackets: after the renamer, HsRnBracketOut carries
   PendingRnSplices for splices in untyped brackets.  In the
   typechecker, these pending splices are typechecked quite
   straigtforwardly, with no ps_var nonsense.

 * Typed brackets: after the renamer typed brackest still look
   like HsBracket. The type checker does the ps_var thing.

 * In TcRnTypes.ThStage, the Brack constructor, we distinguish
   the renaming from typehecking pending-stuff.  Much more
   perspicuous!

 * The "typed" flag is in HsSpliceE, not in HsSplice, because
   only expressions can be typed.  Patterns, types, declarations
   cannot.

There is further improvement to be done to make the handling of
declaration splices more uniform.
20 files changed:
compiler/deSugar/Coverage.lhs
compiler/deSugar/DsExpr.lhs
compiler/deSugar/DsMeta.hs
compiler/hsSyn/HsDecls.lhs
compiler/hsSyn/HsExpr.lhs
compiler/hsSyn/HsExpr.lhs-boot
compiler/hsSyn/HsPat.lhs
compiler/hsSyn/HsTypes.lhs
compiler/hsSyn/HsUtils.lhs
compiler/parser/RdrHsSyn.lhs
compiler/rename/RnExpr.lhs
compiler/rename/RnSplice.lhs
compiler/rename/RnSplice.lhs-boot
compiler/rename/RnTypes.lhs
compiler/typecheck/TcExpr.lhs
compiler/typecheck/TcHsSyn.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcSplice.lhs
compiler/typecheck/TcSplice.lhs-boot