Simon Marlow writes ("RE: Change to Posix.lhs"):
> Should we use a Maybe rather than an exception here? Probably, but then
> System.getVar doesn't return a Maybe, and the Posix library as a whole has a
> tendency towards exceptions rather than Maybe returns. So I'm swithering(*)
> on this one.
The most common use for environment variables is to allow built-in
defaults to be overridden, and in this case they are (obviously)
optional.
Requiring the programmer to do tedious exception-handling for
nonexceptional conditions seems like a bad idea. I agree with Volker
Stolz that nearly no-one would want to use the exception-throwing
version (though it should probably be left in for those rare cases).
Using Maybe makes it easy to provide compiled-in defaults using
fromMaybe.
Ian.