HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Moduleghc-internal-9.1401.0Haskell2010

GHC.Internal.STRef

References in the ST monad.

  • 1 type
  • 3 values
datadata STRef s a
#

a value of type STRef s a is a mutable variable in state thread s, containing a value of type a

Example1 expression
:{runST (do    ref <- newSTRef "hello"    x <- readSTRef ref    writeSTRef ref (x ++ "world")    readSTRef ref ):}"helloworld"

Constructors

Instances1Eq
  • Eq (STRef s a)Defined in ghc-internal-9.1401.0 · GHC.Internal.STRef

    Pointer equality.