4 ms·
The flaw is in the language syntax. With a language that allows a lightweight, more general manipulation of flow you just get open filepath `catch` handle_
by anacrolix 9y ago
The flaw is in the language syntax. With a language that allows a lightweight, more general manipulation of flow you just get
open filepath `catch` handle_file_not_found >>= use_file_handle
handle_file_not_found :: FileNotFoundError -> IO a
use_file_handle :: FileHandle -> IO a
- jstimpfle 9y agoSure, I know Haskell too, and that code above is a mouthful... I'm undecided what is worse in terms of "control flow is all over the code base" and "code is hard to understand" - C++ RAII or Haskell error handling. Moreover the latter comes in a thousand incompatible flavours. Have fun writing Monad transformers :-). It's next to impossible to engineer a robust and readable/maintable application this way (besides simply dying on errors).