Make IOEnv a MonadUnique
[ghc-hetmet.git] / compiler / typecheck / TcRnMonad.lhs
index 7f1a7fe..1f02518 100644 (file)
@@ -40,10 +40,10 @@ import StaticFlags
 import FastString
 import Panic
 import Util
+import Exception
+
 import System.IO
 import Data.IORef
-import Control.Exception
 import Control.Monad
 \end{code}
 
@@ -103,7 +103,7 @@ initTc hsc_env hsc_src keep_rn_syntax mod do_this
                tcg_rn_decls   = maybe_rn_syntax emptyRnGroup,
 
                tcg_binds    = emptyLHsBinds,
-               tcg_deprecs  = NoDeprecs,
+               tcg_warns  = NoWarnings,
                tcg_insts    = [],
                tcg_fam_insts= [],
                tcg_rules    = [],
@@ -324,6 +324,10 @@ newSysLocalIds :: FastString -> [TcType] -> TcRnIf gbl lcl [TcId]
 newSysLocalIds fs tys
   = do { us <- newUniqueSupply
        ; return (zipWith (mkSysLocal fs) (uniqsFromSupply us) tys) }
+
+instance MonadUnique (IOEnv (Env gbl lcl)) where
+        getUniqueM = newUnique
+        getUniqueSupplyM = newUniqueSupply
 \end{code}
 
 
@@ -537,7 +541,11 @@ discardWarnings thing_inside
 
 
 \begin{code}
+#if __GLASGOW_HASKELL__ < 609
 try_m :: TcRn r -> TcRn (Either Exception r)
+#else
+try_m :: TcRn r -> TcRn (Either ErrorCall r)
+#endif
 -- Does try_m, with a debug-trace on failure
 try_m thing 
   = do { mb_r <- tryM thing ;