
#14759: ListSetOps WARNING causes tests to fail -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4628 Wiki Page: | -------------------------------------+------------------------------------- Comment (by niteria): Replying to [comment:14 simonpj]:
PS. One bad case might be this: {{{ import A import B }}} where * A imports A1 which imports A2 .. which import A20, which imports F. * B imports B1 which imports B2 .. which import B20, which imports F. }}} and F has the family instances. I may have to walk down A.hi, A1.hi... to get to F. But it's painful to walk down B1, B2... etc as well.
I think you could mitigate this particular bad case if you did "path compression", that is instead of keeping the `finst-flag`, you remembered the first "interesting" module - a module that either defines it's own family instances or imports two modules with different "interesting" modules. Or framing it in terms of the current logic, a module is "interesting" if the `imp_finst` of a module is a strict superset of `imp_finst` of all the imports. A harder bad case would be a balanced binary tree of imports where only the leaves define type family instances. If you're compiling the root you're forced to load the interfaces of all the modules. It's `n` interface file loads instead of the minimal `n/2`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14759#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler