HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleSTMonadTrans-0.4.8Haskell2010

Control.Monad.ST.Trans.Internal

This module provides the implementation of the STT type for those occasions where it is needed in order to implement new liftings through operations in other monads.

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.

  • 2 types
  • 3 values
newtypenewtype STT s (m :: Type -> Type) a
#

STT is the monad transformer providing polymorphic updateable references

Constructors

Instances30MonadError, MonadReader, MonadState, MonadWriter, MonadTrans, MArray, …
datadata STTRet s a
#

STTRet is needed to encapsulate the unboxed state token that GHC passes around. This type is essentially a pair, but an ordinary pair is not not allowed to contain unboxed types.

Constructors

Instances1Functor
  • Functor (STTRet s)Defined in STMonadTrans-0.4.8 · Control.Monad.ST.Trans.Internal
valueliftST :: Applicative m => ST s a -> STT s m a
#

Lifting the ST monad into STT. The library uses this function extensively to be able to reuse functions from ST.