Example #1
0
        /// <summary>
        /// Instantiates Left with the value of <typeparamref name="TL"/>
        /// </summary>
        /// <param name="left"></param>
        public Either(TL left)
        {
            _left = left;
            State = EitherState.Left;

            _right = default;
        }
Example #2
0
        /// <summary>
        /// Instantiates Right with the value of <typeparamref name="TR"/>
        /// </summary>
        /// <param name="right"></param>
        public Either(TR right)
        {
            _right = right;
            State  = EitherState.Right;

            _left = default;
        }
Example #3
0
 private EitherUnsafe(L left)
 {
     this.state = EitherState.IsLeft;
     this.right = default(R);
     this.left  = left;
 }
Example #4
0
 private EitherUnsafe(R right)
 {
     this.state = EitherState.IsRight;
     this.right = right;
     this.left  = default(L);
 }
Example #5
0
 internal Either(TRight right, TLeft left, EitherState state)
 {
     this.right = right;
     this.state = state;
     this.left  = left;
 }