From 1e3cd905e3f40b03887d2511b449cd4de4e2dc46 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 3 Dec 1999 16:17:44 +0000 Subject: [PATCH] [project @ 1999-12-03 16:17:42 by simonmar] Move fixST and fixIO out of the prelude. --- ghc/lib/std/PrelIOBase.lhs | 6 +----- ghc/lib/std/PrelST.lhs | 7 ------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/ghc/lib/std/PrelIOBase.lhs b/ghc/lib/std/PrelIOBase.lhs index bf7a64f..e39edfc 100644 --- a/ghc/lib/std/PrelIOBase.lhs +++ b/ghc/lib/std/PrelIOBase.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelIOBase.lhs,v 1.15 1999/11/26 16:26:32 simonmar Exp $ +% $Id: PrelIOBase.lhs,v 1.16 1999/12/03 16:17:42 simonmar Exp $ % % (c) The AQUA Project, Glasgow University, 1994-1998 % @@ -75,10 +75,6 @@ instance Monad IO where m >>= k = bindIO m k fail s = error s -- not ioError? - -- not required but worth having around -fixIO :: (a -> IO a) -> IO a -fixIO m = stToIO (fixST (ioToST . m)) - liftIO :: IO a -> State# RealWorld -> STret RealWorld a liftIO (IO m) = \s -> case m s of (# s', r #) -> STret s' r diff --git a/ghc/lib/std/PrelST.lhs b/ghc/lib/std/PrelST.lhs index 9d8855c..1aca5bc 100644 --- a/ghc/lib/std/PrelST.lhs +++ b/ghc/lib/std/PrelST.lhs @@ -53,13 +53,6 @@ data STret s a = STret (State# s) a liftST :: ST s a -> State# s -> STret s a liftST (ST m) = \s -> case m s of (# s', r #) -> STret s' r -fixST :: (a -> ST s a) -> ST s a -fixST k = ST $ \ s -> - let ans = liftST (k r) s - STret _ r = ans - in - case ans of STret s' x -> (# s', x #) - {-# NOINLINE unsafeInterleaveST #-} unsafeInterleaveST :: ST s a -> ST s a unsafeInterleaveST (ST m) = ST ( \ s -> -- 1.7.10.4