Export lists in modules

Simon Peyton-Jones 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
compiled yet.

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.

Simon

| -----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
hs-boot
| file that couldn't be expressed in the corresponding hs file? For
example,
| why doesn't ghc simply require that at least one module in a recursive
group
| contain an explicit export list mentioning only explicitly typed
symbols?
| 
| -- Ben
| 
| _______________________________________________
| Haskell-prime mailing list
| Haskell-prime at haskell.org
| http://haskell.org/mailman/listinfo/haskell-prime


More information about the Haskell-prime mailing list