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 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10
Modulebase-4.23.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"