I just read an article linked on Hacker News advocating the use of
Either<L, R> to signal errors in functions. While I think this is a good start, in my experience
Either is too general, the lack of standardizing of the error value makes error handling abstractions hard. How did that file function signal again that a file was not found?
What works a lot better in my experience is a more specialized type
Status, with a standardized enum of error codes and a free form error message.
Here's an excerpt from the
Status type we use at Google …