Copyright | Josef Svenningsson 2008-2010 (c) The University of Glasgow 1994-2000 |
---|---|
License | BSD |
Maintainer | mckean.kylej@gmail.com |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell2010 |
This library provides a monad transformer version of the ST monad. Warning! This monad transformer should not be used with monads that can contain multiple answers, like the list monad. The reason is that the will be duplicated across the different answers and this cause Bad Things to happen (such as loss of referential transparency). Safe monads include the monads State, Reader, Writer, Maybe and combinations of their corresponding monad transformers.
- data STT s m a
- runSTT :: Monad m => (forall s. STT s m a) -> m a
- fixSTT :: MonadFix m => (a -> STT s m a) -> STT s m a
- newSTTRef :: Monad m => a -> STT s m (STRef s a)
- readSTTRef :: Monad m => STRef s a -> STT s m a
- writeSTTRef :: Monad m => STRef s a -> a -> STT s m ()
- unsafeIOToSTT :: Monad m => IO a -> STT s m a
- unsafeSTToIO :: STT s IO a -> IO a
The ST Monad Transformer
STT
is the monad transformer providing polymorphic updateable references
MonadError e m => MonadError e (STT s m) Source # | |
MonadReader r m => MonadReader r (STT s m) Source # | |
MonadState s m => MonadState s (STT s' m) Source # | |
MonadWriter w m => MonadWriter w (STT s m) Source # | |
MonadTrans (STT s) Source # | |
Monad m => Monad (STT s m) Source # | |
Functor m => Functor (STT s m) Source # | |
MonadFix m => MonadFix (STT s m) Source # | |
(Monad m, Functor m) => Applicative (STT s m) Source # | |
Monad m => PrimMonad (STT s m) Source # | |
type PrimState (STT s m) Source # | |
runSTT :: Monad m => (forall s. STT s m a) -> m a Source #
Executes a computation in the STT
monad transformer
fixSTT :: MonadFix m => (a -> STT s m a) -> STT s m a Source #
Allow the result of a state transformer computation to be used (lazily) inside the computation. Note that if f is strict, fixSTT f = _|_.