Template Haskell quotes aren't reified in source-level Haskell
Summary
The expression, d
, t
, and p
templatehaskell-quotes are syntactically magic, and don't exist anywhere as QuasiQuoter
s. This breaks any chance of composition.
Steps to reproduce
I'm unable to write the following:
transformType :: Type -> Type
tt = QuasiQuoter
tt = QuasiQuoter
{ quoteType = fmap TransformType . quoteType t
}
foo :: [tt| Some Type |]
foo = blah
Instead I need to explicitly inline this composition anywhere I might need it:
foo = $(transformType [t| Some Type |])
foo = blah
Expected behavior
The TH-quotes behave just like any other QuasiQuoter
.