4 ms·
Haskell got exceptions in 1999, I think, but your guess about the motivation as "oh, whoops, result types don't scale" is entirely unfounded. The real issue is
by matt-noonan 8y ago
Haskell got exceptions in 1999, I think, but your guess about the motivation as "oh, whoops, result types don't scale" is entirely unfounded.
The real issue is this: figuring out how to do exceptions in a lazy language is simply not obvious. Work was needed, e.g. https://www.microsoft.com/en-us/research/wp-content/uploads/1999/05/except.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/...
Even so, exceptions are generally not used for error handling in Haskell, yet life seems to go on. You'll see code using `throwError` or `catchError`, but usually these will just be providing a nice bit of sugar on top of an Either or Maybe type. So it seems like the takeaway should be that Result types do scale, with proper library+language support.
- KirinDave 8y agoWe sorta use exceptions for IO-based code, mostly because we love parallel combinators in async and they totally require async exceptions to work right.