mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 02:31:50 +03:00
16 lines
315 B
Idris
16 lines
315 B
Idris
import System.File
|
|
|
|
read10 : String -> IO ()
|
|
read10 fileName = do
|
|
Right f <- openFile fileName Read
|
|
| Left err => printLn err
|
|
Right contents <- fGetChars f 10
|
|
| Left err => printLn err
|
|
printLn contents
|
|
|
|
main : IO ()
|
|
main = do
|
|
read10 "small.txt"
|
|
read10 "big.txt"
|
|
read10 "empty.txt"
|