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)
-
HsSpliced
should be moved toXSplice
. See the TODO there from @alanz.
From @Ericson2314
-
Inline HsSplice
altogether!
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 UntypedSpliceFlavour
to client specificGHC.Hs.Expr
next toPendingRnSplice
-
Find Note [Quase-quote overview]
inGHC.Tc.Gen.Splice
that no longer exists from history -
Refactor IdP id
GHC-specific part intoXTypedSplice
from the constructor ofHsSplice
in L.H.S.Expr