Template haskell quotations guide A Haskell developer seeking reliable documentation for Template Haskell quotation types reports difficulty determining expected types for splices within quotes, such as whether a splice requires `Q Name` or another type. The GHC user guide confirms that only `Q Exp`, `Q Pat`, `Q Type`, and `Q [Dec]` are currently allowed splice types, with a feature request open to expand support for additional types like `Name`. Because of Working towards a more stable Template Haskell https://informal.codes/posts/stabilising-th/ producing-syntax-using-quotes-stable-but-unpopular-type-a , I’m trying to use quotes whenever possible in my template Haskell. Unfortunately, I don’t know what types are expected where in the template haskell quotes. e.g. Pat , Con , Name , Expr Is there a resource that says for example in d| $n :: Int| , n :: Q Name or something? I’m not actually sure what the expected type of n is I’ve been using AI + autocomplete to muddle through, but I’d like reliable documentation. Appreciated examples would be something that fills in boxes like the following: | newtype $ newtype' :: Q Name = $ con' :: Q ? $ type' :: Q ? deriving anyclass $ n :: ? | It’s sadly not possible to splice a value of type Name . See: ghc/ 24922 https://gitlab.haskell.org/ghc/ghc/-/issues/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 https://ghc.gitlab.haskell.org/ghc/doc/users guide/exts/template haskell.html :~:text=A%20top,Dec 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. Sorry for the late response. Thank you, I thought that there were more, as the article led me to believe that quotations could do most of the things that manually creating the AST did. Are there any plans for adding to the supported spices? One day, will I be able to do the type of quotation that I put in my top level post? It can do most but sadly not all. I would love to extend it to support your use-case. It’s quite an important one I am vaguely planning to work on this at some point, but my time to work on TH is quite limited sadly I do it all in my free time .