Idris2/tests/chez/chez018/File.idr

15 lines
390 B
Idris
Raw Normal View History

import System.File
main : IO ()
main
= do Right ok <- readFile "test.txt"
| Left err => printLn err
putStr ok
writeFile "testout.txt" "abc\ndef\n"
Right ok <- readFile "testout.txt"
| Left err => printLn err
putStr ok
Right ok <- readFile "notfound"
| Left err => printLn err
putStr ok