make it possible for the user to force orphanness via a module-level annotation
A module is marked orphan currently only in the case when we detect orphan instances, rules, type families or vectorised stuff.
In the use-case of #7867 (closed), the user will need a way to manage orphanness more directly.
When she creates an annotation (with TH or by hand), it is written to the interface file. When another file directly imports this file, it is read, everything is right. But only orphan modules are searched for transitively. So in the case of command line flags (HFlags library), where we want to transitively read all the annotations (containing info about cmdline flags) in all the imported and grandchild imported modules, we have to mark the originator modules as orphan.
This patch adds support for a special module level annotation that forces this module to be orphan.
This is the first, meaningful, but still small part of a larger work to implement #7867 (closed).
The next part will be TH support to generate annotations (not only) like this.
I'd like to make this two part of 7.8.1, if still possible; because this already makes messaging possible through adhoc datatypes+instances.
After that (probably for 7.10) we only have to make it possible to read (module) annotations back in the Q monad to have a clean solution. The laborious part of that is making module reifyable at all.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |