X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnMonad.lhs;h=dcba8084753937d94e613aab65f714337f9e6762;hb=9e5f0a0f6848dd8234a83d8ff514365aa4717eea;hp=d7988e8d7b49c6fb5ddf48224e4bc5550799c1ec;hpb=62c2f621075d07e043503c8d8e357bbb90158431;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs index d7988e8..dcba808 100644 --- a/compiler/typecheck/TcRnMonad.lhs +++ b/compiler/typecheck/TcRnMonad.lhs @@ -44,11 +44,12 @@ import Bag import Outputable import UniqSupply import Unique -import UniqFM +import LazyUniqFM import DynFlags import StaticFlags import FastString import Panic +import Util import System.IO import Data.IORef @@ -65,11 +66,6 @@ import Control.Monad %************************************************************************ \begin{code} -ioToTcRn :: IO r -> TcRn r -ioToTcRn = liftIO -\end{code} - -\begin{code} initTc :: HscEnv -> HscSource @@ -373,7 +369,7 @@ traceOptTcRn flag doc = ifOptM flag $ do dumpTcRn :: SDoc -> TcRn () dumpTcRn doc = do { rdr_env <- getGlobalRdrEnv ; dflags <- getDOpts ; - ioToTcRn (printForUser stderr (mkPrintUnqualified dflags rdr_env) doc) } + liftIO (printForUser stderr (mkPrintUnqualified dflags rdr_env) doc) } dumpOptTcRn :: DynFlag -> SDoc -> TcRn () dumpOptTcRn flag doc = ifOptM flag (dumpTcRn doc) @@ -651,7 +647,7 @@ checkNoErrs main = do { (msgs, mb_res) <- tryTcLIE main ; addMessages msgs ; case mb_res of - Nothing -> failM + Nothing -> failM Just val -> return val } @@ -820,11 +816,9 @@ debugTc is useful for monadic debugging code \begin{code} debugTc :: TcM () -> TcM () -#ifdef DEBUG -debugTc thing = thing -#else -debugTc thing = return () -#endif +debugTc thing + | debugIsOn = thing + | otherwise = return () \end{code} %************************************************************************