shithub: MicroHs

ref: c5052bb7882174ed1fe11da99dbbe9facb45bcb3
dir: /tests/Catch.hs/

View raw version
module Catch(main) where
import Prelude
import Control.Exception

main :: IO ()
main = do
  x <- catch (return ("o" ++ "k")) (\ _ -> return "what?")
  putStrLn $ showString x
  y <- catch (do { error "bang!"; return "huh?" }) (\ (Exn s) -> return s)
  putStrLn $ showString y