05-08 File Operations and Exceptions (Introduction to Haskell)

preview_player
Показать описание
We give a few examples of functionality we can use now that we have packages such as directory available. We show how to list all files in a directory and determine their sizes. We also discuss exceptions in the context of IO actions. What happens if we access a file that does not exist, or we do not have permission to access? How can we handle such exceptions?

Рекомендации по теме
Комментарии
Автор

Ah, I finally understand how IOError and catching errors works! Thanks :)

From the looks of it, you could define several different error handler functions that handle different errors and use that in the (IOError -> IO a) part.

tobzdaman
join shbcf.ru