<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_default" style="font-family:tahoma,sans-serif">
It sounds awfully special-case to store these type macros in a new field <br>
of `TcGblEnv` instead of as just another kind of `TyCon`.
</div></blockquote><div><br></div><div style="font-family:tahoma,sans-serif" class="gmail_default">But all this is just in your personal fork of GHC, so you can be as special-case as you like. I'd just plough ahead and do the easiest thing. If you make a proposal, and persuade the committee, we can look again. Until then it's probably not worth us spending a lot of time making the implementation beautiful.<br></div><div style="font-family:tahoma,sans-serif" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif" class="gmail_default">Simon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 26 Jul 2022 at 04:14, ÉRDI Gergő <<a href="mailto:gergo@erdi.hu">gergo@erdi.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 25 Jul 2022, Richard Eisenberg wrote:<br>
<br>
> I see this substitution as happening before any type-checking, so zonking shouldn't be an issue. That is, I would expect a<br>
><br>
> substHsTy :: UniqFM Name (HsType GhcRn) -> HsType GhcRn -> HsType GhcRn<br>
><br>
> to do the work, entirely before type-checking.<br>
<br>
If I were to do this fully during renaming, how do I even find out that a <br>
`Name` refers to a type macro? During typechecking I can look up the `TyThing`,<br>
see if it's a `MacroTyCon`, and get the rhs from that. But I don't think we store<br>
anything about already-renamed declarations during renaming the same way <br>
we store info about already-typechecked things during typechecking in <br>
`tcg_type_env`.<br>
<br>
It sounds awfully special-case to store these type macros in a new field <br>
of `TcGblEnv` instead of as just another kind of `TyCon`.<br>
</blockquote></div>