6 ms·
> Now the proposal -- `Let's have a tuple: Either<error_code, return_value> ' The Either data type is not a tuple.
by tianyicui 15y ago
> Now the proposal -- `Let's have a tuple: Either<error_code, return_value> '
The Either data type is not a tuple.
- jerhewet 15y ago"In mathematics and computer science, a tuple is an ordered list of elements. [...] The term originated as an abstraction of the sequence: single, double, triple, quadruple, quintuple, sextuple, septuple, octuple, ..., n‑tuple, ..., where the prefixes are taken from the Latin names of the numerals. The unique 0‑tuple is called the null tuple. A 1‑tuple is called a singleton, a 2‑tuple is called a pair and a 3‑tuple is a triple or triplet." http://en.wikipedia.org/wiki/Tuple http://en.wikipedia.org/wiki/Tuple
- thesz 15y ago"Either" isn't ordered list of elements. It's result of a choice, a tagged sum of sets. So Either is not a tuple by any mean.
- Deestan 15y agoTo elaborate: > "Either" isn't ordered list of elements. Although the Either<T,U> type looks like a pair definition, an Either<T,U> return value contains only one element of type T or U.