{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiairmg66v2nxhi6k2iprfm3jcpffyqbfvahcjsuuxezomushsifyi",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mmyibyhceti2"
},
"path": "/t/homomorphic-static-analysis/14146#post_11",
"publishedAt": "2026-05-29T10:27:27.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"“Tagless-Final”"
],
"textContent": "There are two concerns:\n\n 1. Finding an abstraction that can capture the semantics that we want to express.\n 2. Being able to write it with nice syntax.\n\n\n\nFor point 1 I think normal ASTs like the `Program` data type in one of my previous comments fits the bill (perhaps with more type safety but that is a solved problem for simple types). If you want it to be overloadable you can make use the “Tagless-Final” style, but I don’t care much for that.\n\nI think the only reason this is not a standard approach is because of point 2: GHC does not have a nice syntax for it. You can get far with `RebindableSyntax`, but you run into a wall when you have language constructs which bind variables: lambda, let, and case expressions. Those are all pointful and I assume that is the reason why they are not rebindable yet. With reckoning with variable binding, I mean that we should just choose a representation and make these things rebindable too. I don’t think it is very hard to do that, but I also don’t think there is a nice category theoretic abstraction to capture these variable-binding constructs.",
"title": "Homomorphic static analysis"
}