[GHC] #13102: orphan family instances can leak through the EPS in --make mode

GHC ghc-devs at haskell.org
Wed Jan 11 12:16:58 UTC 2017


#13102: orphan family instances can leak through the EPS in --make mode
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 There are several issues here.  Let's focus on external packages for now.
 By "instance" I mean type-class instance or family instance.

 1.  Ensuring we have ''enough'' instances.  That is, have we loaded
 `M.hi`, and hence added its instances into the `eps_inst_env`?
   * For non-orphan instances, that's guaranteed.
   * Note that it's guaranteed even for wired-in type constructors because
 we do the `checkWiredInTyCon` or `ifCheckWiredInThing`.
   * For orphan instances we need to take care; I think we just
 aggressively load all orphan modules.

 2. Ensuring we do not have ''too many'' instances.  When doing instance
 lookup we don't want to "see" any instances that are not transitively
 below us.
   * Again this is guaranteed for non-orphan instances.
   * For orphan instances we use the cunning plan in comment:2.
   * Wired-in things are below everything so I think it's a non-issue.

 3. Checking family-instance consistency.  Here I am not so clear, but we
 should write down the plan.

 Does that taxonomy help?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13102#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list