[Haskell-cafe] Mutually Recursive Modules

Isaac Dupree isaacdupree at charter.net
Mon Jun 2 09:55:25 EDT 2008

Richard Giraud wrote:
> Hello
> I'm using GHC 6.8.2 with mutally recursive modules.  I'm familiar with 
> how to do simple cases in GHC ({-# SOURCE #-} and .hs-boot files) but I 
> can't figure out how to get it to work for a particular set of modules.
> Is it known (i.e., proven) that GHC 6.8.2 can compile any set of 
> mutually recursive modules without refactoring?  Are there known 
> limitations?

With the old (6.2 and before) .hi-boot scheme where there was no 
abstraction in boot-files, it could probably do anything that it could 
do.  But I'm not convinced with .hs-boot... it can resolve one level of 
cycle, and I don't know how to *prove* that it *can't* do any given 
thing, but I strongly suspect there are things it can't do.  Luckily, it 
is very often the case that your code will be better off anyway if 
refactored to have less module recursion. (though not always.)


More information about the Haskell-Cafe mailing list