public bool Equals(MList <T> first, MList <T> second) { return(first.Match( empty: () => second.Match( empty: () => true, list: (x, xs) => false), list: (x, xs) => second.Match( empty: () => false, list: (y, ys) => x.Equals(y) && Equals(xs, ys)))); }
public int GetHashCode(MList <T> mlist) { return(mlist.Match( empty: () => typeof(T).GetHashCode(), list: (x, xs) => x.GetHashCode() + 31 * GetHashCode(xs))); }