replace error with fail

This commit is contained in:
Harendra Kumar 2017-09-18 16:07:23 +05:30
parent 5df19ce712
commit e560d9140d

View File

@ -30,10 +30,10 @@ game = do
case event of
Harm n -> modify $ \h -> h - n
Heal n -> modify $ \h -> h + n
Quit -> error "quit"
Quit -> fail "quit"
h <- get
when (h <= 0) $ error "You die!"
when (h <= 0) $ fail "You die!"
liftIO $ putStrLn $ "Health = " ++ show h
main = do