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

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

Modulebase-4.22.0.0Haskell2010

GHC.STRef

References in the ST monad.

  • 1 type
  • 3 values
  • Packagebase-4.22.0.0
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSTRef.hs
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.