import DATA_IOREF ( IORef, newIORef, readIORef, writeIORef )
import UNSAFE_IO ( unsafeInterleaveIO )
import FIX_IO ( fixIO )
-import EXCEPTION ( Exception(..), tryJust )
+import EXCEPTION ( Exception(..) )
import IO ( isUserError )
import Maybe ( mapMaybe )
import ListSetOps ( unionLists )
+import Panic ( tryJust )
\end{code}
-- Reflect exception into TcRn monad
tryM (TcRn thing) = TcRn (\ env -> tryJust tc_errors (thing env))
where
-#if __GLASGOW_HASKELL__ > 504
+#if __GLASGOW_HASKELL__ > 504 || __GLASGOW_HASKELL__ < 500
tc_errors e@(IOException ioe) | isUserError ioe = Just e
-#else
- tc_errors e@(IOException _) | isUserError e = Just e
+#elif __GLASGOW_HASKELL__ == 502
+ tc_errors e@(UserError _) = Just e
+#else
+ tc_errors e@(IOException ioe) | isUserError e = Just e
#endif
tc_errors _other = Nothing
-- type checker failures show up as UserErrors only