public class DefaultEither : Either { private A theA; private B theB; private DefaultEither(A _theA, B _theB){ theA = _theA; theB = _theB; } public static DefaultEither newA(A _theA) { return new DefaultEither(_theA,default(B)); } public static DefaultEither newB(B _theB) { return new DefaultEither(default(A),_theB); } public A a() { return theA; } public bool isA() { return theA != null; } public B b() { return theB; } public bool isB() { return theB != null; } }