From 621865f4eca057c8b8600d4e40e30da22e98b0a5 Mon Sep 17 00:00:00 2001 From: sof Date: Sun, 18 May 1997 04:15:13 +0000 Subject: [PATCH] [project @ 1997-05-18 04:15:13 by sof] unsafePerformPrimIO not defined in terms of runST --- ghc/lib/ghc/STBase.lhs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ghc/lib/ghc/STBase.lhs b/ghc/lib/ghc/STBase.lhs index afc3d51..bdc7a65 100644 --- a/ghc/lib/ghc/STBase.lhs +++ b/ghc/lib/ghc/STBase.lhs @@ -54,7 +54,7 @@ returnST = return thenST = (>>=) seqST = (>>) -unsafeInterleaveST :: ST s a -> ST s a -- ToDo: put in state-interface.tex +unsafeInterleaveST :: ST s a -> ST s a unsafeInterleaveST (ST m) = ST $ \ s -> let (r, new_s) = m s @@ -95,9 +95,13 @@ fixPrimIO = fixST {-# GENERATE_SPECS unsafePerformPrimIO a #-} unsafePerformPrimIO :: PrimIO a -> a -unsafeInterleavePrimIO :: PrimIO a -> PrimIO a + -- We give a fresh definition here. There are no + -- magical universal types kicking around. +unsafePerformPrimIO (ST m) + = case m (S# realWorld#) of + (r,_) -> r -unsafePerformPrimIO = runST +unsafeInterleavePrimIO :: PrimIO a -> PrimIO a unsafeInterleavePrimIO = unsafeInterleaveST -- the following functions are now there for backward compatibility mostly: -- 1.7.10.4