#1012: ghc panic with mutually recursive modules and template haskell
------------------------------+---------------------------------------------
 Reporter:  guest             |          Owner:             
     Type:  bug               |         Status:  reopened   
 Priority:  normal            |      Milestone:  6.10 branch
Component:  Template Haskell  |        Version:  6.8.2      
 Severity:  normal            |     Resolution:             
 Keywords:                    |     Difficulty:  Unknown    
 Testcase:  TH_import_loop    |   Architecture:  Multiple   
       Os:  Multiple          |  
------------------------------+---------------------------------------------
Changes (by simonpj):

  * milestone:  _|_ => 6.10 branch

Comment:

 Fair enough. I have taken a little look at this, based on fons's
 suggestion "``every module M that depends on a module C in a cycle, but is
 not a member of that cycle, should have an implicit dependency on each of
 the modules C1.. Cn in the cycle.``". Yes, I think that would not be too
 hard to do.  There are two places to think about:

  * `ghc --make`: When deciding the up-sweep order, first do a SCC analysis
 finding strongly connected components of modules, and top-sort those
 components.  Then linearise each component. That gives a linear order that
 respects fons's suggestion.

  * `ghc -M`: similar story, but less neat.  We have to emit lots of extra
 dependencies in the `makefile`, so that M depends on C1..Cn.

 Not very hard, but more than an hours work.  Let's do it for 6.10.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1012#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to