summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_run/T19841.hs
blob: ff05c19297afbc4ca010cf62c194022532c995fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Main where

import Control.Exception
import Debug.Trace
import System.IO

data MyException = MyException deriving Show
instance Exception MyException

main :: IO ()
main = handle (\ MyException -> hPutStrLn stderr "Exception") $ do
  trace "Debugging" 5
  `seq` throw MyException
  `seq` hPutStrLn stderr "Survived Exception"