[project @ 1999-12-03 16:17:42 by simonmar]
authorsimonmar <unknown>
Fri, 3 Dec 1999 16:17:44 +0000 (16:17 +0000)
committersimonmar <unknown>
Fri, 3 Dec 1999 16:17:44 +0000 (16:17 +0000)
Move fixST and fixIO out of the prelude.

ghc/lib/std/PrelIOBase.lhs
ghc/lib/std/PrelST.lhs

index bf7a64f..e39edfc 100644 (file)
@@ -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
 
index 9d8855c..1aca5bc 100644 (file)
@@ -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 ->