The lazy ST monad.
The ST monad allows for destructive updates, but is escapable (unlike IO).
A computation of type ST s a returns a value of type a, and
executes in "thread" s. The s parameter is either
an uninstantiated type variable (inside invocations of runST), or
It serves to keep the internal states of different invocations of runST separate from each other and from invocations of stToIO.
The >>= and >> operations are not strict in the state. For example,
runST (writeSTRef _|_ v >>= readSTRef _|_ >> return 2) = 2Instances10Monad, Functor, MonadFix, Applicative, PrimBase, PrimMonad, …
Monad (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpFunctor (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpMonadFix (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpApplicative (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpPrimBase (ST s)Defined in primitive-0.9.1.0 · Control.Monad.PrimitivePrimMonad (ST s)Defined in primitive-0.9.1.0 · Control.Monad.PrimitiveInvariant (ST s)Defined in invariant-0.6.4 · Data.Functor.InvariantMArray (STArray s) e (ST s)Defined in array-0.5.8.0 · Data.Array.BaseMonadBase (ST s) (ST s)Defined in transformers-base-0.4.6 · Control.Monad.Basetype PrimState (ST s) = sDefined in primitive-0.9.1.0 · Control.Monad.Primitive