diff options
author | Ian Lynagh <igloo@earth.li> | 2010-11-03 21:22:16 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-11-03 21:22:16 +0000 |
commit | 0eca7e0b307c5862212c9eebfc69af9743ef06f3 (patch) | |
tree | 331873d9dbf0ebe133670c20448c4e21eff3b9a0 /ghc/GhciMonad.hs | |
parent | bdd74e54712349f9c7605cb1e763514a8b99f66f (diff) | |
download | haskell-0eca7e0b307c5862212c9eebfc69af9743ef06f3.tar.gz |
Use liftIO rather than io
Diffstat (limited to 'ghc/GhciMonad.hs')
-rw-r--r-- | ghc/GhciMonad.hs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index 82f2aa7c73..863372ff4a 100644 --- a/ghc/GhciMonad.hs +++ b/ghc/GhciMonad.hs @@ -191,7 +191,7 @@ instance ExceptionMonad GHCi where unGHCi (f g_restore) s instance MonadIO GHCi where - liftIO = io + liftIO = MonadUtils.liftIO instance Haskeline.MonadException GHCi where catch = gcatch @@ -233,9 +233,6 @@ unsetOption opt = do st <- getGHCiState setGHCiState (st{ options = filter (/= opt) (options st) }) -io :: IO a -> GHCi a -io = MonadUtils.liftIO - printForUser :: GhcMonad m => SDoc -> m () printForUser doc = do unqual <- GHC.getPrintUnqual @@ -244,7 +241,7 @@ printForUser doc = do printForUserPartWay :: SDoc -> GHCi () printForUserPartWay doc = do unqual <- GHC.getPrintUnqual - io $ Outputable.printForUserPartWay stdout opt_PprUserLength unqual doc + liftIO $ Outputable.printForUserPartWay stdout opt_PprUserLength unqual doc runStmt :: String -> GHC.SingleStep -> GHCi GHC.RunResult runStmt expr step = do @@ -299,9 +296,9 @@ printTimes allocs psecs revertCAFs :: GHCi () revertCAFs = do - io $ rts_revertCAFs + liftIO rts_revertCAFs s <- getGHCiState - when (not (ghc_e s)) $ io turnOffBuffering + when (not (ghc_e s)) $ liftIO turnOffBuffering -- Have to turn off buffering again, because we just -- reverted stdout, stderr & stdin to their defaults. @@ -350,8 +347,8 @@ initInterpBuffering = do -- make sure these are linked flushInterpBuffers :: GHCi () flushInterpBuffers - = io $ do getHandle stdout_ptr >>= hFlush - getHandle stderr_ptr >>= hFlush + = liftIO $ do getHandle stdout_ptr >>= hFlush + getHandle stderr_ptr >>= hFlush turnOffBuffering :: IO () turnOffBuffering |