Note that:
Exp
in template-haskell
compliance HsExpr
with GHC ASTType
in template-haskell
compliance HsType
with GHC ASTDec
in template-haskell
compliance HsDecl
with GHC AST
However, there is one set of constructors that are missing from the types template-haskell
: those related to TH-splice and quasiquartals. For example, why Exp
doesnβt it have the following constructor?
SpliceE :: Exp -> Exp
I came across this one here . I would like to know if there is something fundamental in this matter, or is there only additional work that needs to be done using TH types? I suspect the problem is that with this one could send TH into an infinite loop - to have a splice creating another splice, and so on. However, there are already many ways to make GHC divergent ... :)
My use case wants to have an additional TH stage (so that I can raise the value at the level of the level - at the parent stage it is the value, but I can generate code with this value raised to the type level for using promote
)
source
share