The strict 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
execute 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 strict in the state (though not in values stored in the state). For example,
runST (writeSTRef _|_ v >>= f) = _|_Instances7Monad, Functor, MonadFix, Applicative, Show, Semigroup, …
Monad (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.STFunctor (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.STMonadFix (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FixApplicative (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.STShow (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STSemigroup a => Semigroup (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STMonoid a => Monoid (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ST