From 339165aa371690ed23b1c3370f0ff7d06e57acd8 Mon Sep 17 00:00:00 2001 From: sof Date: Sat, 5 Jul 1997 01:02:40 +0000 Subject: [PATCH] [project @ 1997-07-05 01:01:11 by sof] Use UnsafeST --- ghc/lib/concurrent/Channel.lhs | 1 + ghc/lib/concurrent/Merge.lhs | 2 +- ghc/lib/ghc/IOBase.lhs | 6 +++++- ghc/lib/ghc/IOHandle.lhs | 1 + ghc/lib/ghc/PrelNum.lhs | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ghc/lib/concurrent/Channel.lhs b/ghc/lib/concurrent/Channel.lhs index 2d0c935..417e139 100644 --- a/ghc/lib/concurrent/Channel.lhs +++ b/ghc/lib/concurrent/Channel.lhs @@ -30,6 +30,7 @@ import Prelude import IOBase ( IO(..) ) -- Suspicious! import ConcBase import STBase +import UnsafeST ( unsafeInterleavePrimIO ) \end{code} A channel is represented by two @MVar@s keeping track of the two ends diff --git a/ghc/lib/concurrent/Merge.lhs b/ghc/lib/concurrent/Merge.lhs index f95678e..3f79413 100644 --- a/ghc/lib/concurrent/Merge.lhs +++ b/ghc/lib/concurrent/Merge.lhs @@ -16,7 +16,7 @@ module Merge import Semaphore import ConcBase -import STBase ( unsafeInterleavePrimIO ) +import UnsafeST ( unsafeInterleavePrimIO ) import IOBase max_buff_size = 1 diff --git a/ghc/lib/ghc/IOBase.lhs b/ghc/lib/ghc/IOBase.lhs index 1d7688b..d2fdd3b 100644 --- a/ghc/lib/ghc/IOBase.lhs +++ b/ghc/lib/ghc/IOBase.lhs @@ -14,13 +14,15 @@ concretely; the @IO@ module itself exports abstractly. module IOBase where import STBase +import UnsafeST import PrelTup import Foreign import PackedString ( unpackCString ) import PrelBase +import ArrBase ( ByteArray(..), MutableVar(..) ) import PrelRead + import GHC -import ArrBase ( ByteArray(..), MutableVar(..) ) infixr 1 `thenIO_Prim`, `seqIO_Prim` \end{code} @@ -141,6 +143,8 @@ errorIO (ST io) where bottom = bottom -- Never evaluated +--errorIO x = (waitRead#, errorIO#, makeForeignObj#, waitWrite#, (+#)) + -- error stops execution and displays an error message error :: String -> a error s = error__ ( \ x -> _ccall_ ErrorHdrHook x ) s diff --git a/ghc/lib/ghc/IOHandle.lhs b/ghc/lib/ghc/IOHandle.lhs index b3b145f..c367403 100644 --- a/ghc/lib/ghc/IOHandle.lhs +++ b/ghc/lib/ghc/IOHandle.lhs @@ -15,6 +15,7 @@ which are supported for them. module IOHandle where import ST +import UnsafeST import STBase import ArrBase ( ByteArray(..) ) import PrelRead ( Read ) diff --git a/ghc/lib/ghc/PrelNum.lhs b/ghc/lib/ghc/PrelNum.lhs index e329d74..6cf3dcd 100644 --- a/ghc/lib/ghc/PrelNum.lhs +++ b/ghc/lib/ghc/PrelNum.lhs @@ -25,7 +25,7 @@ import {-# SOURCE #-} IOBase ( error ) import PrelList import ArrBase ( Array, array, (!) ) -import STBase ( unsafePerformPrimIO ) +import UnsafeST ( unsafePerformPrimIO ) import Ix ( Ix(..) ) import Foreign () -- This import tells the dependency analyser to compile Foreign first. -- There's an implicit dependency on Foreign because the ccalls in -- 1.7.10.4