{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreifcsisou73iy2hk3tuer6pj63ffb2gtv3sfipmlznwrwnbdtdsgni",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mnajnpy6e5g2"
  },
  "path": "/t/template-haskell-quotations-guide/14185#post_1",
  "publishedAt": "2026-06-01T14:37:33.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "Working towards a more stable Template Haskell"
  ],
  "textContent": "Because of Working towards a more stable Template Haskell, 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\nin `[d| $n :: Int|]`, `n :: Q Name` or something? (I’m not actually sure what the expected type of `n` is )\nI’ve been using AI + autocomplete to muddle through, but I’d like reliable documentation.\nAppreciated examples would be something that fills in boxes like the following:\n\n\n    [| newtype $(newtype' :: Q Name) = $(con' :: Q ?) $(type' :: Q ?) deriving anyclass ($(n :: ?))|]\n",
  "title": "Template haskell quotations guide"
}