[Haskell-cafe] Solving the configuration problem with parametrized modules
Joachim Breitner
mail at joachim-breitner.de
Tue Sep 6 16:36:42 CEST 2011
Hi Jon,
Am Dienstag, den 06.09.2011, 14:01 +0100 schrieb Jon Fairbairn:
> Joachim Breitner <mail at joachim-breitner.de> 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 at joachim-breitner.de
Homepage: http://www.joachim-breitner.de
Jabber-ID: nomeata at joachim-breitner.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110906/33836519/attachment.pgp>
More information about the Haskell-Cafe
mailing list