Mutually-recursive/cyclic module imports
John Meacham
john at repetae.net
Tue Aug 26 19:31:33 EDT 2008
A very good paper on what it actually "means" to have recursive modules
is presented in this paper:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.6.8816
in jhc, it is implemented in the module FrontEnd.Exports.
I think the main rule that should be followed is that the name
resolutions generated with the hs-boot files should _never_ conflict
with the name resolution that would happen were the compiler to support
full mutually recursive modules as described in the above paper. That
way tools that need them can use the hs-boot files and tools that don't
can ignore them and still be guarenteed to get the same results. This
doesn't necessarily mean that implementations need to support full
recursive modules, just that where they do, they don't conflict with a
full implementation.
In terms of dependency chasing, why not have the tools do it? ghc has
the '-M' option, though, it its current form it isn't very convinient to
use (I always have to postprocess its output), it shouldn't be too tough
to beef it up a little.
though, I would love it if haddock performed full recursive inter-module
name resolution. If anyone wants to use jhc's code to achieve these
goals, I will hapilly relicense any parts wanted under the MIT/2 clause
bsd or ghc license upon asking.
John
--
John Meacham - ⑆repetae.net⑆john⑈
More information about the Haskell-prime
mailing list