Skip to content

Instantly share code, notes, and snippets.

@ehamberg
Created March 11, 2013 22:07
Show Gist options
  • Save ehamberg/5138284 to your computer and use it in GitHub Desktop.
Save ehamberg/5138284 to your computer and use it in GitHub Desktop.
import Data.IORef
f ref = writeIORef ref 2
main = do
putStrLn "Look! Mutation!"
myRef <- newIORef 1
v <- readIORef myRef
(putStrLn . show) v
f myRef
v <- readIORef myRef
(putStrLn . show) v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment