Created
November 23, 2015 12:10
-
-
Save chuck0523/713227dd374e1cd633d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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