3 ms·
Sounds like it’s a convoluted way to implement the same kind of thing that you’d get with a traditional error throwing paradigm
by woah 8y ago
Sounds like it’s a convoluted way to implement the same kind of thing that you’d get with a traditional error throwing paradigm
- hderms 8y agoWhat's convoluted about it? Exceptions jumping up multiple stacks and being rescued or reraised or what have you is convoluted. If you mean errors as return values then I agree, monads are more complicated than returning a simple error type.
- jecxjo 8y agoThe part you might be missing is that you're explicitly told "this function returns a value OR and error. You must handle error cases with this function". With the try/catch paradigm you never know from the function definition if that is the case. You also know what type the error will be. No need to derive a new class from `Error` and add custom functions to extract the data from your failure case, just pass the data along.