public static SortedIntervals <U> Union <T, U>(this SortedIntervals <T> intervals, Func <IEnumerable <T>, U> reduce) { return(new SortedIntervals <U>(intervals.UnionEnumerator().Select(g => g.Range(reduce)))); }
public static SortedIntervals <T[]> Union <T>(this SortedIntervals <T> intervals) { return(new SortedIntervals <T[]>(intervals.UnionEnumerator().Select(g => g.Range()))); }