Idris2/tests/chez/chez003/IORef.idr
Edwin Brady a972778eab Add test script
They don't all pass yet, for minor reasons. Coming shortly...
Unfortunately the startup overhead for chez is really noticeable here!
2020-05-19 18:25:18 +01:00

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