Proposal: System.Environment.getEnv should return Maybe

Brandon Allbery allbery.b at gmail.com
Sun Mar 11 20:51:50 CET 2012


On Sun, Mar 11, 2012 at 14:12, Henning Thielemann <
lemming at henning-thielemann.de> wrote:

> On Fri, 24 Feb 2012, Conrad Parker wrote:
>
>> On 23 February 2012 20:18, John Lato <jwlato at gmail.com> wrote:
>>
>>> This irritates me too; I don't think that Haskell exceptions should be
>>> used for much of anything, exceptional condition or not.
>>>
>>
>> +1 to the general concept of not using Haskell exceptions in library code.
>>
>
>  This depends on what you call "exception". The exception handling part of
> the IO monad? The general concept of an exceptional situation? I think if
> you request the value of a variable, but that variable turns out to not
> exist, then the question was not valid and that is somehow an exceptional
> situation.


Is looking up a missing key in a Map an exception?  That is exactly this
case ("variable" is really only an appropriate term from the standpoint of
the shell, which [sometimes inappropriately] conflates the environment with
its own variables).  Or are you arguing that that also should be an
exception?

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120311/8ee6dcdf/attachment.htm>


More information about the Libraries mailing list