
25 Jul
2022
25 Jul
'22
6:04 a.m.
On Mon, 25 Jul 2022, Simon Peyton Jones wrote:
Do we have an existing way of substituting types over type variables, *in HsType instead of Core Type*?
I'm afraid not. Currently HsType is not processed much -- just renamed and typechecked into a Type.
I wonder if, instead, I could expand the rhs, typecheck it "abstractly" (i.e. in the context of the synonym's binders), and THEN do the substitution. If I typecheck the rhs for every occurrence, I should get fresh metavars for each wildcard, which is pretty much what I want. I just have to make sure I don't zonk before the substitution. Does this make sense?