Skip to content

Difference between Either and Result #1226

Answered by louthy
juchom asked this question in Q&A
Discussion options

You must be logged in to vote

Writing this response on my phone, so apologies for brevity and lack of markup/formatting.

Never use Result is the short answer. Result may be deprecated at some point (because this question comes up a lot and clearly causes confusion), mostly because it was only ever designed as an intermediate type for Try, not as a fully fledged monadic type (like Either or Fin)

That's also the reason it sits in a different namespace, so it wouldn't be used accidentally; and so it wouldn't cause naming conflicts with other libraries that use Result (very common name).

Fin<A> is actually closer to Result<A>, it is like Either<Error, A>. It's called Fin to be short and easy to use, unlikely to conflict w…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@juchom
Comment options

Answer selected by juchom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants