From f10947d79cdfac8f8b065ef51a10d9c9cf3c19bc Mon Sep 17 00:00:00 2001 From: Ross Paterson Date: Thu, 9 Sep 2010 12:55:31 +0000 Subject: [PATCH] avoid Foreign.unsafePerformIO --- compiler/ghci/ByteCodeFFI.lhs | 2 +- compiler/ghci/RtClosureInspect.hs | 4 ++-- compiler/main/InteractiveEval.hs | 3 ++- compiler/utils/FastString.lhs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/ghci/ByteCodeFFI.lhs b/compiler/ghci/ByteCodeFFI.lhs index 0f149c3..1589fe1 100644 --- a/compiler/ghci/ByteCodeFFI.lhs +++ b/compiler/ghci/ByteCodeFFI.lhs @@ -9,7 +9,7 @@ module ByteCodeFFI ( moan64 ) where import Outputable import System.IO -import Foreign +import System.IO.Unsafe moan64 :: String -> SDoc -> a moan64 msg pp_rep diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index e39a0bc..a23d355 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -75,8 +75,8 @@ import Data.List import qualified Data.Sequence as Seq import Data.Monoid import Data.Sequence (viewl, ViewL(..)) -import Foreign --- import System.IO.Unsafe +import Foreign hiding (unsafePerformIO) +import System.IO.Unsafe --------------------------------------------- -- * A representation of semi evaluated Terms diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 3f932dc..13267bd 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -78,7 +78,7 @@ import System.Directory import Data.Dynamic import Data.List (find, partition) import Control.Monad -import Foreign +import Foreign hiding (unsafePerformIO) import Foreign.C import GHC.Exts import Data.Array @@ -87,6 +87,7 @@ import Control.Concurrent import Data.List (sortBy) -- import Foreign.StablePtr import System.IO +import System.IO.Unsafe -- ----------------------------------------------------------------------------- -- running a statement interactively diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs index 8fcd419..a357f98 100644 --- a/compiler/utils/FastString.lhs +++ b/compiler/utils/FastString.lhs @@ -95,7 +95,7 @@ import FastFunctions import Panic import Util -import Foreign +import Foreign hiding ( unsafePerformIO ) import Foreign.C import GHC.Exts import System.IO -- 1.7.10.4