[Haskell-cafe] Cyclic Inclusions
cmb21 at kent.ac.uk
Tue Aug 12 13:38:11 EDT 2008
> The problem is not mutually recursive modules. Plenty of statically
> typed languages support mutually recursive modules.
> The problem is that it's impossible in general to say what the
> "interface" of a module is by examining the module alone. This is a
> very unusual property as real-world programming languages go.
> You could fix this by, for example, requiring that all symbols
> exported from a module have an explicit type annotation. Or, if you
> think that's not lazy enough, it could be an error to use an imported
> symbol that doesn't have an explicit type annotation. You could even
> formalise .hi-boot files if you were truly desperate.
I don't really see this as being any kind of real issue at all. Surely all
GHC needs to do is to concatenate all the modules together, alpha-reduce
the import/export relations and do a compile/type check over the
> If the Haskell spec requires that multiple modules be analysed
> simultaneously (or multiple times to fixpoint), then that's a bug in
> the spec. Separate compilation is too important.
Why is it a bug in the spec exactly? And why is separate compilation so
More information about the Haskell-Cafe