X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FMonad%2FST.hs;h=46ae8a22bfc8c80557cdbcb9300c7a69b367ec10;hb=53aa4bc647eea9934b431b970f6ce531e992df43;hp=0e3485725e40d34c4a1f141a7ee0686d535d3c27;hpb=3e23aaae1a1f07fd28f1092d0f79e13d66b72f09;p=ghc-base.git diff --git a/Control/Monad/ST.hs b/Control/Monad/ST.hs index 0e34857..46ae8a2 100644 --- a/Control/Monad/ST.hs +++ b/Control/Monad/ST.hs @@ -10,24 +10,25 @@ -- -- This library provides support for /strict/ state threads, as -- described in the PLDI \'94 paper by John Launchbury and Simon Peyton --- Jones /Lazy State Threads/. +-- Jones /Lazy Functional State Threads/. -- ----------------------------------------------------------------------------- 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 @@ -53,11 +54,11 @@ unsafeInterleaveST = #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.IOBase ( stToIO, unsafeIOToST, unsafeSTToIO ) #endif instance MonadFix (ST s) where - mfix = fixST + mfix = fixST