
29 Aug
2001
29 Aug
'01
4:56 p.m.
In GHC, you can do this:
import Exception
do result <- catch (evaluate (read "foo" :: Int)) (\error -> ... )
Note that this works in Hugs too. Well, it does in the cvs repository version... [Personally, I'd write this code the way Patrik and use exceptions only for those cases which can't be handled any other way or where the overhead of threading exceptions around is too high.] -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/