> Attached is a patch of what I did to my Posix.lhs. The problem is that
> 'getEnvVar' will throw an exception when the variable is not 
> present in the
> environment. Thus, I'm proposing 'mayGetEnvVar', which will return
> Nothing | Just String. I can't think of a reason why anyone 
> would want to use
> the old version :) [And it even won't break things.]
> 
> First I tried hiding PosixProcPrim.getEnvVar to make my 
> getEnvVar the new
> default, but this would have been too tedious since I'd have 
> had to rewrite the
> exports-part of Posix.lhs (can't have 'hiding'/'qualified' there).

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.

Cheers,
        Simon

(*) Glaswegian term, somewhere between "dithering" and "swaying"

Reply via email to