3 ms·
The number of variables doesn't matter, as long as they are the same type is the part that matters. <T, E> can be thought of as a pair, tuple, cartesian produc
by bcheung 7y ago
The number of variables doesn't matter, as long as they are the same type is the part that matters.
<T, E> can be thought of as a pair, tuple, cartesian product. Likewise you can expand it to as many values as you want.
If type C is just (T, E) then it is really just Result<C> at that point.
The first T can vary but as long as everything after that is fixed to the same type, you can have as many variables/types as you want and it will still be monadic.
- efnx 6y agoYou’re reducing two type variables down to one. The number of type variables matter. The kind of the type matters. Look at the definition of Monad for Either. You’ll see.