first-class modules

Feuer feuer@his.com
Tue, 26 Mar 2002 12:31:44 -0500


A number of people have discussed the use of implicit parameters to
mimic global variables in Haskell.  I am wondering if any have done the
same for a first-class module system such as that proposed by Shields
and Jones.  It seems to make a tremendous amount of sense to do it that
way:

1.  semi-constant values:  Things that are calculated or input at the
beginning of the program could be handled by Main.main, which would pass
the results to the Second module, whose main function it could then
call.  This seems much more natural than the implicit parameter approach
for this purpose.

2.  others:  whenever a group of functions are likely to share a
particular argument, they can be grouped in a module for greater
convenience.  For example, a library of mathematical functions that
should all share a certain precision indicator could be grouped in a
module:  the user of the module could instantiate it once with the right
precision and then use all the functions at that precision.


David Feuer
(please reply to dfeuer@cs.brown.edu)