From: simonmar Date: Tue, 31 Jul 2001 13:31:44 +0000 (+0000) Subject: [project @ 2001-07-31 13:31:44 by simonmar] X-Git-Tag: nhc98-1-18-release~1191 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f0c198839f03909745a2c5bda37296e2923d030c;p=haskell-directory.git [project @ 2001-07-31 13:31:44 by simonmar] merge hslibs/lang/ST.lhs rev. 1.14 --- diff --git a/Control/Monad/ST.hs b/Control/Monad/ST.hs index 61bdc97..5f47360 100644 --- a/Control/Monad/ST.hs +++ b/Control/Monad/ST.hs @@ -8,7 +8,7 @@ -- Stability : experimental -- Portability : non-portable (requires universal quantification for runST) -- --- $Id: ST.hs,v 1.3 2001/07/03 11:37:49 simonmar Exp $ +-- $Id: ST.hs,v 1.4 2001/07/31 13:31:44 simonmar Exp $ -- -- The State Transformer Monad, ST -- @@ -37,6 +37,9 @@ import GHC.ST import GHC.Prim ( unsafeCoerce#, RealWorld ) import GHC.IOBase ( IO(..), stToIO ) +-- This relies on IO and ST having the same representation modulo the +-- constraint on the type of the state +-- unsafeIOToST :: IO a -> ST s a unsafeIOToST (IO io) = ST $ \ s -> (unsafeCoerce# io) s #endif