Quick actions

cmd+k|ctrl+k

Navigation

Languages

ST safety: nested computations

Snippet info

Language

Haskell

Visibility

public

Author

rightfold

Created

2016-09-11T17:34:20Z

Updated

2016-09-11T17:36:33Z

import Control.Monad.ST
import Data.STRef

f :: Int
f = runST $ do
  x <- newSTRef 1
  return $ runST $ do
    x' <- readSTRef x
    return x'

main = putStrLn "Hello World!"
INFO