GetOpt formatting improvements

Neil Mitchell ndmitchell at
Wed Jul 2 12:42:25 EDT 2008


>  > I think thats a really bad idea. We want options that work and do the
>  > sensible thing. When would a user want to set these options to
>  > different values? Without a use case, and a potential user, these
>  > extra variants are a waste of hard-drive space.
> I thought the use case I had in mind was apparent from the context: finding
>  out the terminal width and then setting the wrap-width accordingly. And the
>  max. description indentation could be set as a percentage of the terminal
>  width. This is all quite similar to what pretty printing libs allow.

I'd suggest a much better idea would be to have one function which did
all this, in the IO Monad. Some sort of
showTheGetOptHelpWithTheRightWidth :: IO (). Before adding a function
I think its important to ask "what will this function be used for" -
if there are no particularly good answers, then its best not to add
it. If it happens to be a general case of something where everyone
will want a specific case then the specific case seems more appealing.

>  Generally I think that hard-coding numerical constants in code is nearly
>  always a very bad idea.

Agreed :-)



More information about the Libraries mailing list