
Hi Jon, Am Dienstag, den 06.09.2011, 14:01 +0100 schrieb Jon Fairbairn:
Joachim Breitner
writes: this is an idea that has been floating in my head for a while, and I’m wondering about its feasibility and, if feasible, complexity (in the range from „trivial“ over “blog post” over “paper” to “thesis”).
Application authors in Haskell often face the problem of run-time constants, e.g. values that are expected to be determined once during program start and then stay fixed for the remainder of the run. Good examples are user configuration values (--verbose, certain paths, debugging level, etc.).
There are two aspects to this, both of which have potential solutions that I’ve been thinking about on and off for a long time.
The first is command line arguments.
As far as I’m concerned they ought to be passed as a parameter to the whole programme. So instead of main being a value exported to the outside world and all importing of values being done through the IO monad, we would have main going out and argv::[String] as a global variable (which, of course would not change during any run of the programme).
Right. You already think of the command line parameters as constants and expect them to be provided to you as such. My idea enables that, but not only for command line parameters but anything that you know is initialized at the start of the program. Greetings, Joachim -- Joachim Breitner e-Mail: mail@joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata@joachim-breitner.de