• Simon Peyton Jones's avatar
    Another raft of Template Haskell clean-up · 51deeb0d
    Simon Peyton Jones authored
    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
     * The "typed" flag is in HsSpliceE, not in HsSplice, because
       only expressions can be typed.  Patterns, types, declarations
    There is further improvement to be done to make the handling of
    declaration splices more uniform.
DsExpr.lhs 32.9 KB