TTG follow-up: Template Haskell related
These are TODOs regarding TTG to follow !4782 (closed):
Quoting @simonpj:
I see that UntypedSpliceFlavour is used only in the client specific GHC.Hs.Expr; but it is defined in the client-independent L.H.S.Expr. Let's move it next to PendingRnSplice.
In L.H.S.Expr I see
| HsQuasiQuote -- See Note [Quasi-quote overview] in GHC.Tc.Gen.Splice
But that Note doesn't exist. Can we find it from history?
In L.H.S.Expr I see
data HsSplice id
= HsTypedSplice -- $$z or $$(f 4)
(XTypedSplice id)
SpliceDecoration -- Whether $$( ) variant found, for pretty printing
(IdP id) -- A unique name to identify this splice point
(LHsExpr id) -- See Note [Pending Splices]
The (IdP id) part is very GHC-specific. It should be in XTypedSplice.
Formally in #16830 (closed)
-
HsSplicedshould be moved toXSplice. See the TODO there from @alanz.
From @Ericson2314
-
Inline HsSplicealtogether!
Just as we now have Hs{Untyped,Typed}Bracket, untyped and typed splices, and quasiquotes, are all distinct syntax, and come from morally distinct extensions. They should have separate top-level AST nodes too, for that reason, and for consistency's sake!
To close this issue we should
-
Move UntypedSpliceFlavourto client specificGHC.Hs.Exprnext toPendingRnSplice -
Find Note [Quase-quote overview]inGHC.Tc.Gen.Splicethat no longer exists from history -
Refactor IdP idGHC-specific part intoXTypedSplicefrom the constructor ofHsSplicein L.H.S.Expr
Edited by Rodrigo Mesquita