a value of type STRef s a is a mutable variable in state thread s,
containing a value of type a
:{runST (do ref <- newSTRef "hello" x <- readSTRef ref writeSTRef ref (x ++ "world") readSTRef ref ):}"helloworld"
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11
Modulebase-4.22.0.0Haskell2010
Mutable references in the lazy ST monad.
a value of type STRef s a is a mutable variable in state thread s,
containing a value of type a
:{runST (do ref <- newSTRef "hello" x <- readSTRef ref writeSTRef ref (x ++ "world") readSTRef ref ):}"helloworld"