import qualified ErrUtils
import Exception
-import Data.Maybe
+-- import Data.Maybe
import Numeric
import Data.Array
-import Data.Char
+-- import Data.Char
import Data.Int ( Int64 )
import Data.IORef
-import Data.List
+-- import Data.List
import System.CPUTime
import System.Environment
import System.IO
setLogAction = do
encoder <- getEncoder
dflags <- GHC.getSessionDynFlags
- GHC.setSessionDynFlags dflags {log_action = logAction encoder}
+ _ <- GHC.setSessionDynFlags dflags {log_action = logAction encoder}
return ()
where
logAction encoder severity srcSpan style msg = case severity of
-- ToDo: we should really look up these names properly, but
-- it's a fiddle and not all the bits are exposed via the GHC
-- interface.
- mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziHandle_stdin_closure"
- mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziHandle_stdout_closure"
- mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziHandle_stderr_closure"
+ mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdin_closure"
+ mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdout_closure"
+ mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stderr_closure"
let f ref (Just ptr) = writeIORef ref ptr
f _ Nothing = panic "interactiveUI:setBuffering2"
- zipWithM f [stdin_ptr,stdout_ptr,stderr_ptr]
- [mb_stdin_ptr,mb_stdout_ptr,mb_stderr_ptr]
- return ()
+ zipWithM_ f [stdin_ptr,stdout_ptr,stderr_ptr]
+ [mb_stdin_ptr,mb_stdout_ptr,mb_stderr_ptr]
flushInterpBuffers :: GHCi ()
flushInterpBuffers