mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-21 20:01:30 +03:00
17 lines
332 B
Idris
17 lines
332 B
Idris
|
import Data.IORef
|
||
|
|
||
|
main : IO ()
|
||
|
main
|
||
|
= do x <- newIORef 42
|
||
|
let y = x
|
||
|
writeIORef y 94
|
||
|
val <- readIORef x
|
||
|
printLn val
|
||
|
val <- readIORef y
|
||
|
printLn val
|
||
|
modifyIORef x (* 2)
|
||
|
val <- readIORef x
|
||
|
printLn val
|
||
|
val <- readIORef y
|
||
|
printLn val
|