From 36fa8c4890e439fe8c2a4682df2a877fa2cc606b Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Thu, 17 Jan 2008 21:52:33 +0000 Subject: [PATCH] Replace remaining uses of ioToIOEnv by liftIO, remove ioToIOEnv --- compiler/iface/BinIface.hs | 2 +- compiler/utils/IOEnv.hs | 4 ---- compiler/vectorise/VectMonad.hs | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/iface/BinIface.hs b/compiler/iface/BinIface.hs index 4f2457c..12bde11 100644 --- a/compiler/iface/BinIface.hs +++ b/compiler/iface/BinIface.hs @@ -54,7 +54,7 @@ import Control.Monad readBinIface :: FilePath -> TcRnIf a b ModIface readBinIface hi_path = do nc <- getNameCache - (new_nc, iface) <- ioToIOEnv $ readBinIface_ hi_path nc + (new_nc, iface) <- liftIO $ readBinIface_ hi_path nc setNameCache new_nc return iface diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 222b42f..224147f 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -28,7 +28,6 @@ module IOEnv ( tryM, tryAllM, tryMostM, fixM, -- I/O operations - ioToIOEnv, IORef, newMutVar, readMutVar, writeMutVar, updMutVar ) where #include "HsVersions.h" @@ -133,9 +132,6 @@ unsafeInterleaveM (IOEnv m) = IOEnv (\ env -> unsafeInterleaveIO (m env)) instance MonadIO (IOEnv env) where liftIO io = IOEnv (\ env -> io) -ioToIOEnv :: IO a -> IOEnv env a -ioToIOEnv io = IOEnv (\ env -> io) - newMutVar :: a -> IOEnv env (IORef a) newMutVar val = liftIO (newIORef val) diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs index a7e0a28..57f87d3 100644 --- a/compiler/vectorise/VectMonad.hs +++ b/compiler/vectorise/VectMonad.hs @@ -58,7 +58,7 @@ import NameEnv import TysPrim ( intPrimTy ) import Module import IfaceEnv -import IOEnv ( ioToIOEnv ) +import IOEnv ( liftIO ) import DsMonad import PrelNames @@ -503,7 +503,7 @@ initV hsc_env guts info p builtin_prs <- initBuiltinPRs builtins builtin_boxed <- initBuiltinBoxedTyCons builtins - eps <- ioToIOEnv $ hscEPS hsc_env + eps <- liftIO $ hscEPS hsc_env let famInstEnvs = (eps_fam_inst_env eps, mg_fam_inst_env guts) instEnvs = (eps_inst_env eps, mg_inst_env guts) -- 1.7.10.4