24 Jun
2004
24 Jun
'04
10:54 a.m.
With reference to "mapException", I thought this seemed a good idea. I like the 'AnnotatedException' idea... this is much better than concatenating strings... However for not I thought I would test it as is, but it doesn't work as I thought - perhaps someone could point out where I have gone wrong. 1) this works: main :: IO () main = do a <- getLine hPutStrLn $ showInt (fst . head . readDec $ a :: Int) `Exception.catch` (\e -> throw $ ErrorCall $ showString "Urk :" $ show e) 2) this doesn't work: main :: IO () main = mapException (\x -> ErrorCall $ showString "Urk :" $ show x) $ do a <- getLine hPutStrLn $ showInt (fst . head . readDec $ a :: Int) Keean. (using GHC-6.2)