
22 Oct
2009
22 Oct
'09
1:21 a.m.
Apparently the old exception library had convenience functions like 'arithExceptions' that could be used with 'handleJust'. handleJust arithExceptions handler thing With the new module you can write something like this (I determined this from experimentation): arithExceptionTester :: ArithException -> IO () arithExceptionTester = Just () handleJust arithExceptionTester handler thing Two questions: (1) Is there a better way to do things? (2) I don't understand quite how the type system works. Somehow, on exceptions that aren't arithmetic, arithExceptionTester returns Nothing or at least behaves that way. Yet I didn't write any code to do that. Can someone explain this? Thanks, Mike