In retrospect, I think that Sigbjorn is probably right that the added
complexity of psuedoconstant and performOnceBeforeMain outweigh their
usefulness, given that only this argv debate has been demonstrated as an
instance of the problem they solve. (Unlike Fergus, I don't think that the
ability to make other things global constants is such a hot idea -- hmm,
unless perhaps they were projected/parsed out of argv or the environment?)
Since it seems many people anticipate first-class modules eventually making
it into Haskell, I support Claus Reinke's suggestion to provide a simplified
form now for use with argv (and possibly the shell environment as shown
below). Compared with the other generalized solutions, it seems to
* be conceptually simple for users
* make dependencies explicit
* promote the spirit of functional programming, and
* be compatible with future changes to Haskell incorporating first-class
modules.
In lieu of this, and pending a firmer basis and more motivation for the
performOnce... solutions, I suppose I would be willing now to make argv a
constant, perhaps if the Report mentioned explicitly the down side of taking
advantage of such a feature.
I still think that making argv constant encourages large, monolithic
programs, and modern languages should instead be aiming for decentralized
components, but realistically most programs, especially functional ones, are
still written for the UNIX batch-style, command-line execution paradigm.
Simply making argv a global constant still leaves the programmer a choice, so
it's a reasonable practical compromise.
>>>>> "Claus" == Claus Reinke <[EMAIL PROTECTED]> writes:
> module Main env where
> import Compiler (env.argv) (env.env "MY_LIBRARY_PATH")
> main = .. (env.env "HOME") ..
> Without a major overhaul of the module system, the use of parameterized
> modules may be restricted, but if a simple variant is good enough for the
> current problem, it will at least be compatible with future extensions.
--
Frank Christoph Next Solution Co. Tel: 0424-98-1811
[EMAIL PROTECTED] Fax: 0424-98-1500