Export lists in modules
simonpj at microsoft.com
Fri Feb 24 07:13:14 EST 2006
These days, hs-boot files are pretty close to source files, with masses
of stuff omitted.
However, you must process the import declarations of the hs-boot file to
figure out the name spaces involved. In the original source file, you
can't process the import declarations because those modules have not
been compiled yet. It's not clear which ones to omit.
Similarly in the body of the source file, there are lots of references
to things in imported modules, but those imported modules have not been
You could imagine
a) compiling recursive groups "all at once"
b) somehow magically filtering the source file to omit anything
undefined, leaving only defined stuff..... which ought to be enough to
tie the knot.
But GHC currently requires the programmer to perform (b) manually.
| -----Original Message-----
| From: haskell-prime-bounces at haskell.org
[mailto:haskell-prime-bounces at haskell.org] On Behalf Of
| Ben Rudiak-Gould
| Sent: 23 February 2006 21:26
| To: haskell-prime at haskell.org
| Subject: Re: Export lists in modules
| Malcolm Wallace wrote:
| > An explicit interface would be useful for many purposes besides
| > machine-checked documentation. For instance, it could be used to
| > eliminate the hs-boot or hi-boot files used by some compilers when
| > dealing with recursive modules.
| Why *does* ghc require hs-boot files? What can be gleaned from an
| file that couldn't be expressed in the corresponding hs file? For
| why doesn't ghc simply require that at least one module in a recursive
| contain an explicit export list mentioning only explicitly typed
| -- Ben
| Haskell-prime mailing list
| Haskell-prime at haskell.org
More information about the Haskell-prime