Hacker News new | ask | show | jobs
by ghc 4669 days ago
I don't find this true at all. Haskell exceptions don't look like exceptions in other languages, so it's easy to get hung up on the fact that error is generally used only for unrecoverable errors. But that's why it's called error, not exception. In Haskell, Either and Maybe are used where I would normally use try/except in Python.

The only exception to this that I've found is that error is something you may need to deal with in the IO monad, where in Python it would still be handled via exceptions.

1 comments

Well, I didn't think of Maybe and Either as exceptions, but rather considered undefined/error. The exceptions from Control.Exception are probably the closest to exceptions in other languages, and I think those are built on error.