Skip to content

Make sure ModIface values are still forced even if not written

Matthew Pickering requested to merge wip/stricter-modiface into master

When we are not writing a ModIface to disk then the result can retain a lot of stuff. For example, in the case I was debugging the DocDeclsMap field was holding onto the entire HomePackageTable due to a single unforced thunk. Therefore, now if we're not going to write the interface then we still force deeply it in order to remove these thunks.

The fields in the data structure are not made strict because when we read the field from the interface we don't want to load it immediately as there are parts of an interface which are unused a lot of the time.

Also added a note to explain why not all the fields in a ModIface field are strict and made the code agree with it.

The result of this is being able to load Agda in ghci and not leaking information across subsequent reloads.

Merge request reports