projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1999-12-29 14:46:29 by simonpj]
[ghc-hetmet.git]
/
ghc
/
tests
/
io
/
should_run
/
io002.hs
1
import System (getEnv)
2
3
import IO ( isDoesNotExistError )
4
5
main :: IO ()
6
main = do
7
term <- getEnv "TERM"
8
putStrLn "Got $TERM"
9
fish <- getEnv "One fish, two fish, red fish, blue fish" `catch` getEnv_except
10
putStrLn fish
11
12
getEnv_except :: IOError -> IO String
13
getEnv_except ioe
14
| isDoesNotExistError ioe = return ""
15
| otherwise = ioError ioe