From: sof Date: Sun, 18 May 1997 04:15:13 +0000 (+0000) Subject: [project @ 1997-05-18 04:15:13 by sof] X-Git-Tag: Approximately_1000_patches_recorded~677 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=621865f4eca057c8b8600d4e40e30da22e98b0a5;p=ghc-hetmet.git [project @ 1997-05-18 04:15:13 by sof] unsafePerformPrimIO not defined in terms of runST --- 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: