Idris2/tests/node/node018/File.idr

15 lines
399 B
Idris
Raw Normal View History

2020-06-12 23:35:08 +03:00
import System.File
main : IO ()
main
= do Right ok <- readFile "test.txt"
| Left err => printLn err
putStr ok
ignore $ writeFile "testout.txt" "abc\ndef\n"
2020-06-12 23:35:08 +03:00
Right ok <- readFile "testout.txt"
| Left err => printLn err
putStr ok
Right ok <- readFile "notfound"
| Left err => printLn err
putStr ok