<div dir="ltr"><div>Sure, you can remove them once you are sure they are not used anymore. <br></div><div><br></div><div>For clients like `GHCi` that doesn't work obviously as they can be used at any point in the future but for a batch compiler it would be fine.<br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Feb 10, 2025 at 11:56 AM É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, 10 Feb 2025, Matthew Pickering wrote:<br>
<br>
> I wonder if you have got your condition the wrong way around. <br>
> <br>
> The only "safe" time to perform rehydration is AFTER the point it can never be used<br>
> again.<br>
> <br>
> If you rehydrate it just before it is used then you will repeat work which has already<br>
> been done. If you do this, you will always have a trade-off between space used and<br>
> runtime.<br>
<br>
Oops. Yes, I have misunderstood the idea. I thought the idea was that <br>
after loading a given module into the HPT, its ModDetails would start <br>
out small (because of laziness) and then keep <br>
growing in size as more and more of it are traversed, and thus <br>
forced, during the typechecking of its dependees, so at some point we <br>
would want to reset that into the small initial representation as created <br>
by initModDetails.<br>
<br>
But if the idea is that I should rehydrate modules when they can't be used <br>
anymore, then that brings up the question why even do that, instead of <br>
straight removing the HomeModInfos from the HPT?</blockquote></div>