[project @ 2002-04-24 16:31:37 by simonmar]
[ghc-base.git] / Control / Monad / ST.hs
index 61bdc97..6d19b9c 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- 
+-- |
 -- Module      :  Control.Monad.ST
 -- Copyright   :  (c) The University of Glasgow 2001
 -- License     :  BSD-style (see the file libraries/core/LICENSE)
@@ -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.6 2002/04/24 16:31:38 simonmar Exp $
 --
 -- The State Transformer Monad, ST
 --
@@ -34,9 +34,12 @@ import Data.Dynamic
 
 #ifdef __GLASGOW_HASKELL__
 import GHC.ST
-import GHC.Prim                ( unsafeCoerce#, RealWorld )
+import GHC.Base                ( 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