blob: 4a012bf436a8abfef82745f07e7674d16735d638 (
plain)
1
2
3
4
5
6
7
8
9
10
|
import Control.Exception
-- This should result in the "What" exception, not the undefined.
{-# NOINLINE f #-}
f :: Int -> Int -> IO Int
f x y | x>0 = throwIO (userError "What")
| y>0 = return 1
| otherwise = return 2
main = f 2 undefined >>= print
|