Enhanced C#
Language of your choice: library documentation

Holds a single value of one of two types (L or R). More...
Holds a single value of one of two types (L or R).
For efficiency, this is a struct, but this makes it possible to defaultconstruct it. In that case its value will be default(R)
.
Public fields  
Maybe< L >  Left => _hasLeft ? _left : new Maybe<L>() 
Maybe< R >  Right => _hasLeft ? new Maybe<R>() : _right 
object  Value => _hasLeft ? (object)_left : _right 
IMaybe< L > IEither< L, R >.  Left => Left 
IMaybe< R > IEither< L, R >.  Right => Right 
Public Member Functions  
static Either< L, R >  R (value) 
static Either< L, R >  R (value) 
Either (L value)  
Either (R value)  
Either< L2, R2 >  Select< L2, R2 > (Func< L, L2 > selectL, Func< R, R2 > selectR) 
Converts an Either to another with different types. More...  
Static Public Member Functions  
static Either< L, R >  NewLeft (L value) 
Simply calls the constructor. This method exists to make it possible to construct an Either when both types are the same. More...  
static Either< L, R >  NewRight (R value) 
Simply calls the constructor. This method exists to make it possible to construct an Either when both types are the same. More...  
static implicit  operator Either< L, R > (L value) 
static implicit  operator Either< L, R > (R value) 
static Either< L, R >  From< L2, R2 > (Either< L2, R2 > x) 
Does an upcast, e.g. Either{string,ArgumentException} to Either{object,Exception}. C# does not allow defining conversion operators to take generic parameters, so you'll have to put up with this hassle instead. More...  
Additional Inherited Members  
Properties inherited from Loyc.IEither< L, R >  
IMaybe< L >  Left [get] 
IMaybe< R >  Right [get] 
Properties inherited from Loyc.IHasValue< object >  
T  Value [get] 

static 
Does an upcast, e.g. Either{string,ArgumentException} to Either{object,Exception}. C# does not allow defining conversion operators to take generic parameters, so you'll have to put up with this hassle instead.
Sadly, automatically upcasting value types to reference types doesn't seem possible.
L2  :  L  
R2  :  R  
R2  :  new  
R2  :  Either  
R2  :  L  
R2  :  R  
R2  :  x._hasLeft  
R2  :  x._left  
R2  :  x._right 

static 
Simply calls the constructor. This method exists to make it possible to construct an Either when both types are the same.

static 
Simply calls the constructor. This method exists to make it possible to construct an Either when both types are the same.
Either<L2, R2> Loyc.Either< L, R >.Select< L2, R2 >  (  Func< L, L2 >  selectL, 
Func< R, R2 >  selectR  
) 
Converts an Either to another with different types.