mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-15 14:23:32 +03:00
15 lines
399 B
Idris
15 lines
399 B
Idris
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"
|
|
Right ok <- readFile "testout.txt"
|
|
| Left err => printLn err
|
|
putStr ok
|
|
Right ok <- readFile "notfound"
|
|
| Left err => printLn err
|
|
putStr ok
|