public override int GetHashCode() { var hashCode = 0; unchecked { if (LeftContext != null) { hashCode = (23 * hashCode) + LeftContext.GetHashCode(); } if (LeftValue != null) { hashCode = (23 * hashCode) + LeftValue.GetHashCode(); } if (LeftSetter != null) { hashCode = (23 * hashCode) + LeftSetter.GetHashCode(); } if (RightValue != null) { hashCode = (23 * hashCode) + RightValue.GetHashCode(); } if (RightSetter != null) { hashCode = (23 * hashCode) + RightSetter.GetHashCode(); } if (RightContext != null) { hashCode = (23 * hashCode) + RightContext.GetHashCode(); } } return(hashCode); }
/// <summary> /// Returns a hash code of the wrapped value of the Either /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() => IsBottom ? -1 : IsRight ? RightValue == null ? 0 : RightValue.GetHashCode() : LeftValue == null ? 0 : LeftValue.GetHashCode();
public override int GetHashCode() { var hashCode = Rule.GetHashCode(); unchecked { hashCode = (23 * hashCode) + BaseCorrespondence.GetHashCode(); if (LeftValue != null) { hashCode = (23 * hashCode) + LeftValue.GetHashCode(); } if (RightValue != null) { hashCode = (23 * hashCode) + RightValue.GetHashCode(); } } return(hashCode); }