Idris2/tests/base/system_directory/ReadDir.idr
Stiopa Koltsov 4eff6ac916 System.Directory.listDir
This function is what users want 99.9% of time.
2021-07-17 14:58:57 +01:00

13 lines
284 B
Idris

import System
import System.Directory
panic : String -> IO a
panic s = do putStrLn s
exitFailure
main : IO ()
main = do Right ["a"] <- listDir "dir"
| Left e => panic (show e)
| Right x => panic ("wrong entries: " ++ (show x))
pure ()