Simon L Peyton Jones, you wrote:
>
> Fergus
>
> | I would find Simon's arguments more convincing if he showed
> | a convenient idiom that did things properly, rather than a
> | convenient way to write broken programs.
> |
> | (Doing it properly is probably not too hard, but I'll leave it up to
> | the proponents of this proposal to demonstrate this...)
>
> It's hard for me to respond to this since I don't know what you have in mind
> when you say "properly". If you mean proper error reporting, then that's
> not difficult:
>
> main = checkArgForErrors argv >>
> ....rest of prog...
[aside: presumably you can drop the argv parameter, since you want
argv to be a constant, right?]
> I'm not sure what else you had in mind.
Just that, together with Joe Fasel's suggestions, plus putting
the argument-parsing stuff in an exception monad, and defining
`checkArgForErrors' to check whether the option structure is
`Fail message'.
One difference between doing it "properly" and doing it the
way you suggested in your original post is that doing it properly
is significantly more complex. This alters the trade-offs a bit.
(Sorry if I've been a bit pedantic -- see my .sig ;-)
P.S. Is this list archived anywhere?
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.