
I'm trying to update a package that uses 'Control.OldException' (works with GHC 6.10.4). Here is a relevant (and simplified) part: import Control.OldException -- | A predicate matching synchronous exceptions. syncExceptions :: Exception -> Maybe Exception syncExceptions (AsyncException _) = Nothing syncExceptions e = Just e throwAsync :: IO a throwAsync = throwIO $ AsyncException StackOverflow throwArith :: IO a throwArith = throwIO $ ArithException DivideByZero 'syncExceptions' is usually used like this: *Main> tryJust syncExceptions throwArith Left divide by zero *Main> tryJust syncExceptions throwAsync -- pass through *** Exception: stack overflow The above doesn't work with GHC 7.6.3 because 'Control.OldException' [1] was removed. And 'Control.Exception' doesn't have the 'Exception' type. Is there a way to adapt 'syncExceptions' to work with 'Control.Exception'? [1] http://hackage.haskell.org/packages/archive/base/4.1.0.0/doc/html/Control-Ol...