[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / io / io005 / Main.hs
1 import LibSystem (system, ExitCode(..), exitWith)
2
3 main = 
4     system "cat dog 1>/dev/null 2>&1" >>= \ ec ->
5     case ec of
6         ExitSuccess   -> putStr "What?!?\n" >> fail "dog succeeded"
7         ExitFailure _ ->
8             system "cat Main.hs 2>/dev/null" >>= \ ec ->
9             case ec of
10                 ExitSuccess   -> exitWith ExitSuccess
11                 ExitFailure _ -> putStr "What?!?\n" >> fail "cat failed"