3 ms·
For reference, Haskell's version of that is called Either. You also sometimes use ErrorT which is a way to slap an Either on any other Monad. The T just denote
by tikhonj 15y ago
For reference, Haskell's version of that is called Either.
You also sometimes use ErrorT which is a way to slap an Either on any other Monad. The T just denotes that it's a monad transformer.
Coincidentally, I agree wholeheartedly about how practical programming like this is--this sort of error handling is at once easier and more explicit than exceptions.
- jules 15y agoWhy is it easier? That's just doing the monad transformation by hand instead of letting a compiler take care of that for you (in the case of EitherT and do-notation the compiler takes care of the intraprocedural transformation for you). It's rather in the same category as Node.js programmers doing CPS transform by hand.