Replace remaining uses of ioToIOEnv by liftIO, remove ioToIOEnv
authorTwan van Laarhoven <twanvl@gmail.com>
Thu, 17 Jan 2008 21:52:33 +0000 (21:52 +0000)
committerTwan van Laarhoven <twanvl@gmail.com>
Thu, 17 Jan 2008 21:52:33 +0000 (21:52 +0000)
compiler/iface/BinIface.hs
compiler/utils/IOEnv.hs
compiler/vectorise/VectMonad.hs

index 4f2457c..12bde11 100644 (file)
@@ -54,7 +54,7 @@ import Control.Monad
 readBinIface :: FilePath -> TcRnIf a b ModIface
 readBinIface hi_path = do
   nc <- getNameCache
 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
 
   setNameCache new_nc
   return iface
 
index 222b42f..224147f 100644 (file)
@@ -28,7 +28,6 @@ module IOEnv (
        tryM, tryAllM, tryMostM, fixM, 
 
        -- I/O operations
        tryM, tryAllM, tryMostM, fixM, 
 
        -- I/O operations
-       ioToIOEnv,
        IORef, newMutVar, readMutVar, writeMutVar, updMutVar
   ) where
 #include "HsVersions.h"
        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)
 
 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)
 
 newMutVar :: a -> IOEnv env (IORef a)
 newMutVar val = liftIO (newIORef val)
 
index a7e0a28..57f87d3 100644 (file)
@@ -58,7 +58,7 @@ import NameEnv
 import TysPrim       ( intPrimTy )
 import Module
 import IfaceEnv
 import TysPrim       ( intPrimTy )
 import Module
 import IfaceEnv
-import IOEnv         ( ioToIOEnv )
+import IOEnv         ( liftIO )
 
 import DsMonad
 import PrelNames
 
 import DsMonad
 import PrelNames
@@ -503,7 +503,7 @@ initV hsc_env guts info p
         builtin_prs    <- initBuiltinPRs builtins
         builtin_boxed  <- initBuiltinBoxedTyCons builtins
 
         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)
 
         let famInstEnvs = (eps_fam_inst_env eps, mg_fam_inst_env guts)
             instEnvs    = (eps_inst_env     eps, mg_inst_env     guts)