summaryrefslogtreecommitdiff
path: root/libraries/base/tests/ioref001.hs
blob: 837b82e0c169f302c18f64b34cb47634cb2a08a8 (plain)
1
2
3
4
5
6
7
8
9

module Main where

import Data.IORef

loop r 0 = return ()
loop r c = loop r (c-1) >> writeIORef r 42

main = newIORef 0 >>= \r -> loop r 1000000 >> putStrLn "done"