[GHC] #8337: make it possible for the user to for orphanness of an annotation
GHC
ghc-devs at haskell.org
Fri Sep 20 17:33:32 CEST 2013
#8337: make it possible for the user to for orphanness of an annotation
-------------------------------------------+-------------------------------
Reporter: errge | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Easy (less than 1 hour) | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking: 7867
-------------------------------------------+-------------------------------
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, 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.
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.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8337>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list