Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created November 23, 2015 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/713227dd374e1cd633d8 to your computer and use it in GitHub Desktop.
Save chuck0523/713227dd374e1cd633d8 to your computer and use it in GitHub Desktop.
import Data.IORef
main = do
v <- newIORef 0
c <- readIORef v
print c
writeIORef v (c + 1)
c2 <- readIORef v
print c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment