Template haskell quotations guide
Haskell Community [Unofficial]
June 1, 2026
It’s sadly not possible to splice a value of type Name. See: ghc/#24922
Sometimes you can splice a Name by turning it into a Exp, Pat or Type.
Splicing is documented here: 6.13. Template Haskell — Glasgow Haskell Compiler 9.15.20260306 User's Guide
So, the only allowed types (currently) are Q Exp, Q Pat, Q Type and Q [Dec].
Type errors can be a helpful way if finding out what is expected. If you put something of type Q Exp where you need a Q Pat, then the error should tell you.
Discussion in the ATmosphere