On Fri, Mar 25, 2011 at 4:33 AM, Josh Berry <[email protected]> wrote:
> With Either types and proper usage of map/flatMap
> (usually in a for comprehension), the errors are easy to propagate up
> where they can be dealt with correctly.
>
Either types help with the "wrapping the information" aspect, which is
undoubtedly superior to a HRESULT or encoding errors in variants ("ok,
result = Foo()" that Go and Erlang seem to love so much).
However, Either types do nothing for the propagation: you still end up
having to 1) have all your methods return an Either type and 2) do the
bubbling up yourself.
I want the language to take care of 2) for me and for 1), a `throws`
signature is a much more sensitive place to identify the potential errors
that can happen than the return type, which I'd like to save for my own
usage.
--
Cédric
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.