+{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST
module Control.Monad.ST
(
- -- * The 'ST' Monad
- ST, -- abstract, instance of Functor, Monad, Typeable.
- runST, -- :: (forall s. ST s a) -> a
- fixST, -- :: (a -> ST s a) -> ST s a
-
- -- * Converting 'ST' to 'IO'
- RealWorld, -- abstract
- stToIO, -- :: ST RealWorld a -> IO a
-
- -- * Unsafe operations
- unsafeInterleaveST, -- :: ST s a -> ST s a
- unsafeIOToST -- :: IO a -> ST s a
+ -- * The 'ST' Monad
+ ST, -- abstract, instance of Functor, Monad, Typeable.
+ runST, -- :: (forall s. ST s a) -> a
+ fixST, -- :: (a -> ST s a) -> ST s a
+
+ -- * Converting 'ST' to 'IO'
+ RealWorld, -- abstract
+ stToIO, -- :: ST RealWorld a -> IO a
+
+ -- * Unsafe operations
+ unsafeInterleaveST, -- :: ST s a -> ST s a
+ unsafeIOToST, -- :: IO a -> ST s a
+ unsafeSTToIO -- :: ST s a -> IO a
) where
-import Prelude
-
import Control.Monad.Fix
#include "Typeable.h"
#endif
#ifdef __GLASGOW_HASKELL__
-import GHC.ST ( ST, runST, fixST, unsafeInterleaveST )
-import GHC.Base ( RealWorld )
-import GHC.IOBase ( stToIO, unsafeIOToST )
+import GHC.ST ( ST, runST, fixST, unsafeInterleaveST )
+import GHC.Base ( RealWorld )
+import GHC.IO ( stToIO, unsafeIOToST, unsafeSTToIO )
#endif
instance MonadFix (ST s) where
- mfix = fixST
+ mfix = fixST