Refactor ModIface to group together logical parts of the interface
Over the years interface files have been added to in an ad-hoc manner.
The different parts can be summarised as follows.
- Simple information about the module (module name, unit etc)
- Information about the ABI of the module (things other modules need to know about the module the interface is for)
- Information about the module itself that's needed for the recompilation checker.
- Extensible fields (things the user wants to store in an interface file)
- Simplified core, things that the bytecode interpreter needs to restart the compilation pipeline
- Documentation (enabled by -haddock)
- The top-level environment of the module (used by GHCi, the debugger, haddock etc)
The top-level of the interface file should be expressed in these terms, then it is also straightforward to specify what the "ABI hash" of a module is (everything in the public part of the interface), and people don't need to think about this when adding new things to interfaces.