Skip to content
Snippets Groups Projects
Commit 3143d1e2 authored by sof's avatar sof
Browse files

[project @ 1997-07-05 01:00:41 by sof]

Moved unsafe* to UnsafeST
parent 8d69b9e3
No related merge requests found
......@@ -56,13 +56,6 @@ returnST = return
thenST = (>>=)
seqST = (>>)
unsafeInterleaveST :: ST s a -> ST s a
unsafeInterleaveST (ST m) = ST $ \ s ->
let
(r, new_s) = m s
in
(r, s)
fixST :: (a -> ST s a) -> ST s a
fixST k = ST $ \ s ->
let (ST k_r) = k r
......@@ -95,17 +88,6 @@ type PrimIO a = ST RealWorld a
fixPrimIO :: (a -> PrimIO a) -> PrimIO a
fixPrimIO = fixST
{-# GENERATE_SPECS unsafePerformPrimIO a #-}
unsafePerformPrimIO :: PrimIO a -> 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
unsafeInterleavePrimIO :: PrimIO a -> PrimIO a
unsafeInterleavePrimIO = unsafeInterleaveST
-- the following functions are now there for backward compatibility mostly:
{-# GENERATE_SPECS returnPrimIO a #-}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment