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).

Volker (who still tries to learn diffing/patching)
-- 
Volker Stolz * [EMAIL PROTECTED] * PGP
*** Posix.lhs   Fri Mar 17 12:32:19 2000
--- Posix.lhs   Fri Mar 17 12:10:50 2000
***************
*** 16,21 ****
      runProcess,
  
-     mayGetEnvVar,
- 
      ByteCount,
      Fd, intToFd,
--- 16,19 ----
***************
*** 48,53 ****
  import PosixUtil
  
- import Exception
- 
  -- [OLD COMMENT:]
  -- runProcess is our candidate for the high-level OS-independent primitive 
--- 46,49 ----
***************
*** 114,120 ****
                    return ()
  
- mayGetEnvVar :: String -> IO (Maybe String)
- mayGetEnvVar var = do
-   catchAllIO (PosixProcPrim.getEnvVar var >>= (\x -> return (Just x))) -- can only 
be NoSuchThing
-                    (\_ -> return Nothing)
  \end{code}
--- 110,112 ----

Reply via email to