shithub: MicroHs

ref: d65bc804563c41d1be4a6620ccde395555cb6da9
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 $ show x
  y <- catch (do { error "bang!"; return "huh?" }) (\ (Exn s) -> return s)
  putStrLn $ show y