1

Closed

LeftValue and RightValue should be internal

description

Could LeftValue<TLeft, TRight> & RightValue<TLeft, TRight> be private?
 
Static factory could work.
 
Create<TLeft,TRight>(TLeft leftValue)
Create<TLeft,TRight>(TRight rightValue)
Closed Jun 23, 2011 at 11:26 PM by davedev
Included in Rxx 1.1.

comments

jamesmiles wrote May 4, 2011 at 8:37 AM

Hmm... what if TLeft & TRight are the same type?

jamesmiles wrote May 4, 2011 at 8:40 AM

This would be ambiguous...

Test.Create<int, int>(42);

davedev wrote Jun 3, 2011 at 6:24 AM

LeftValue and RightValue classes are now internal for Rxx 1.1. To create Left and Right instances of the abstract Either<TLeft, TRight> class in the future, use the new static factory methods: Either.Left<TLeft, TRight>(TLeft value) and Either.Right<TLeft, TRight>(TRight value), respectively.