Mutually-recursive/cyclic module imports

Duncan Coutts duncan.coutts at
Sat Aug 16 20:28:09 EDT 2008

On Sat, 2008-08-16 at 13:51 -0400, Isaac Dupree wrote:
> Duncan Coutts wrote:
> > [...]
> > 
> > I'm not saying it's a problem with your proposal, I'd just like it to be
> > taken into account. For example do dependency chasers need to grok just
> > import lines and {-# SOURCE -#} pragmas or do they need to calculate
> > fixpoints.
> Good point.  What does the dependency chaser need to figure out?
> - exactly what dependency order files must be compiled 
> (e.g., ghc -c) ?
> - what files (e.g., .hi) are needed to be findable by the 
> e.g. (ghc -c) ?
> - recompilation avoidance?

It needs to work out which files the compiler will read when it compiles
that module.

So currently, I think we just have to read a single .hs file and
discover what modules it imports. We then can map those to .hi
or .hs-boot files in one of various search dirs or packages.

We also need to look at {#- SOURCE #-} import pragmas since that means
we look for a different file to ordinary imports.

Calculating dependency order and recompilation avoidance are things the
dep program has to do itself anyway. The basics is just working out what
things compiling a .hs file depends on. Obviously it's somewhat
dependent on the Haskell implementation.


More information about the Haskell-prime mailing list