[0]: http://elm-lang.org/blog/announce/0.14.elm#making-error-hand...
[1]: http://static.rust-lang.org/doc/master/std/result/index.html
[0]: http://elm-lang.org/blog/announce/0.14.elm#making-error-hand...
[1]: http://static.rust-lang.org/doc/master/std/result/index.html
I also got tired of explaining "the good result goes in Right, because it's 'Right'" like I'm endlessly telling a bad dad-joke.
Here's the first instance of what would become Rust's `Result` type (Oct 28 2011): https://github.com/rust-lang/rust/commit/c1092fb6d88efe51e42...
Note that the type is called `t` since the convention at the time was to name the primary type of a module `t` and then refer to the type as `modulename::t` (shows how far we've come, eh?). At this initial stage the variants are named `ok` and `error`. Also note that at this point in history Rust had had an `either` type for a while (https://github.com/rust-lang/rust/blob/c1092fb6d88efe51e42df...), which would later be removed as Result gained more traction.
Here's the commit where the `error` variant is renamed to `err` (Oct 28 2011, so the same day): https://github.com/rust-lang/rust/commit/2b62a80202e2855d47f...
Here's the first instance of `std::result` being mentioned in the mailing list (Nov 14 2011): http://article.gmane.org/gmane.comp.lang.rust.devel/891
Where the type itself is renamed to `result` (Mar 13 2012): https://github.com/rust-lang/rust/commit/b968c8e6cd362567bf0...
Where the type and variant names are capitalized in accordance with the current style guide (Aug 26 2012): https://github.com/rust-lang/rust/commit/0c6e470a257fc546555...
So this convention may very well have originated with Rust.
"Either" is IMO a nice counterpart to tuple types: one is a generic sum, the other is a generic product. People could complain that a tuple of ints are less descriptive than just using a constructor with a more descriptive name - like "Pair" or "Coordinate", depending on its intended application.
Having a specialized type for error handling makes sense, though.