on 5e2000e help sign in
Idris-dev/test/basic021/basic021.idr
13 lines 249 B history raw
1import Data.IORef
3count : Nat -> IORef Integer -> IO ()
4count Z ref
5 = do x <- readIORef ref
6 printLn x
7count (S k) ref
8 = do modifyIORef ref (+1)
9 count k ref
11main : IO ()
12main = do r <- newIORef 0
13 count 1000000 r