Allow generation of TTH syntax with TH
Motivation
That is useful in cases where a library is build with TTH in mind, but we still want to generate some auxiliary declarations, where TTH cannot help us, but untyped TH can. One such example is staged-sop
which works with TTH, but we would like to derive Generic
declarations with TH.
An alternative approach is to use unsafeCodeCoerce
, but then the derived Generic
instances would be type-checked only at use sites, i.e. much later. Also -ddump-splices
output is quite ugly: user-written instances would use TTH brackets, not unsafeCodeCoerce
.
Proposal
In other words allow generation of typed splices and brackets with Untyped Template Haskell.