Interesting! I like that, let me add it as a note for extensible-hasclass. As mentioned above, you could implement hasclass with the th version, but with your idea, we could also recover the th version with HasClass. One slight difference is that the th version takes in splices as Q Exp, so the th version could theoretically inspect/modify the expressions before interpolation
Rather than $(lift [| x + y|]), I think you want $([| x + y|]).
Good point!
If it gets desugared like so then it should work:
foo x y = $(hacky"a ${[| x + y|]} b")
-- desguars to
foo x y = $(hacky [Left "a", Right (HasClass [| x + y|]), Left "b")
Though this is quite verbose, and eliminating verbosity is the aim of this proposal.
A future proposal could drop the extra parens if this is sufficiently useful
I feel like we should aim to either handle these cases well in this proposal or try to go for something really quite minimal and leave the extensible case wholesale to a later one.