Original-Via: uk.ac.ed.dcs; Thu, 17 Oct 91 18:04:19 BST
(a general remark:)
The aim of modularisation is (mainly) to govern
in a divide-and-conquer way huge tasks.
What is _huge_ depends on the ability/taste/[insert your favourite ...]
of the humans having to deal with the task
(and sometimes even on the tools they use, eg. C compilers).
Prohibiting mutual recursive modules also prohibits
the division of mutual-recursive tasks.
(end of lesson)
Another question is whether it is a good idea to keep
the recursion of modules implicit, as for value declarations.
I doubt that, because modules are not first-class citizens
in Haskell, they are on top of the language.
One way to make it explicit would be the introduction
of _parameterised_modules_. Having this feature in Haskell would allow
to exclude recursive imports, but to keep recursive dependency
between modules. A mutual recursive dependency between two
modules A and B could be expressed by
abstracting the imported parts from A and B
(that gives the parameterised modules \x.A and \y.B,
where x and y are the formal parameters) and connecting them
via a third module, in which exports from A can be taken as
actual parameters (y) to get an instance of B and vice versa.
So the mutually recursive modules are gained by ordinary
mutual recursive dependency between declarations (of types,
values,...).
Stefan