-tryTc :: TcM a -> TcM (Messages, Maybe a)
--- Just like tryM, except that it ensures that the LIE
+try_m :: TcRn m r -> TcRn m (Either Exception r)
+-- Does try_m, with a debug-trace on failure
+try_m thing
+ = do { mb_r <- tryM thing ;
+ case mb_r of
+ Left exn -> do { traceTc (exn_msg exn); return mb_r }
+ Right r -> return mb_r }
+ where
+ exn_msg exn = text "recoverM recovering from" <+> text (showException exn)
+
+tryTcLIE :: TcM a -> TcM (Messages, Maybe a)
+-- Just like tryTc, except that it ensures that the LIE