1 import System (system, ExitCode(..), exitWith)
4 system "cat dog 1>/dev/null 2>&1" >>= \ ec ->
6 ExitSuccess -> putStr "What?!?\n" >> fail (userError "dog succeeded")
8 system "cat io005.hs 2>/dev/null" >>= \ ec ->
10 ExitSuccess -> exitWith ExitSuccess
11 ExitFailure _ -> putStr "What?!?\n" >> fail (userError "cat failed")