For example, given <@ let x = <@ 1 @> in x @> and <@ let x = <@@ 1 @@> in x @>, I can match both with Patterns.Let(_, (Patterns.Quote(_) as q), _) -> q but I can’t differentiate between the typed and untyped q.
For example, given <@ let x = <@ 1 @> in x @> and
Share
Interesting. It seems that quotations are always stored in the typed form.
The type of the
<@@ 1 @@>sub-expression inside the quotation is alwaysExpr<int>. However, the type of the variablexdiffers in your two quotations:But I’m not sure how to use this to differentiate between the two cases in general. It seems that you can only do that if you look at the context (and there are just too many possible context…)