blob: ce5b9617c9af2bea3226b701097715d38148ba20 (
plain)
1
2
3
4
5
6
7
8
9
|
import Control.Exception
-- Ensure that catch catches exceptions thrown during the evaluation of the
-- action-to-be-executed. This should output "it failed".
main :: IO ()
main = catch (error "uh oh") handler
handler :: SomeException -> IO ()
handler _ = putStrLn "it failed"
|