예제 #1
0
파일: Either.cs 프로젝트: SNUGDC/BeerWorld
 public int CompareTo(Either <L, R> other)
 {
     return(isLeft ? (other.isLeft ? Smooth.Collections.Comparer <L> .Default.Compare(leftValue, other.leftValue) : -1) :
            other.isLeft ? 1 : Smooth.Collections.Comparer <R> .Default.Compare(rightValue, other.rightValue));
 }
예제 #2
0
파일: Either.cs 프로젝트: SNUGDC/BeerWorld
 public bool Equals(Either <L, R> other)
 {
     return(isLeft ? other.isLeft && Smooth.Collections.EqualityComparer <L> .Default.Equals(leftValue, other.leftValue) :
            !other.isLeft && Smooth.Collections.EqualityComparer <R> .Default.Equals(rightValue, other.rightValue));
 }