catchEither is more general than catch and allows you to change the left value's type
Both are Haskell98
More advanced users can use EitherR and ExceptRT to program in an
entirely symmetric "success monad" where exceptional results are the norm
and successful results terminate the computation. This allows you to chain
error-handlers using do notation and pass around exceptional values of
varying types until you can finally recover from the error:
runExceptRT $ do
e2 <- ioExceptionHandler e1
bool <- arithmeticExceptionhandler e2
when bool $ lift $ putStrLn "DEBUG: Arithmetic handler did something"
If any of the above error handlers succeed, no other handlers are tried.
If you choose not to typefully distinguish between the error and sucess
monad, then use flipEither and flipET, which swap the type variables without
changing the type.