Computes the union of two range sets, merging overlapping and adjacent ranges.
When ranges overlap or are adjacent with equal values, they are merged into a single range.
When ranges overlap with different values, the overlapping portion gets a merged value
according to the value merge function, and non-overlapping portions are preserved.
Computes the union of two range sets, merging overlapping and adjacent ranges.
When ranges overlap or are adjacent with equal values, they are merged into a single range. When ranges overlap with different values, the overlapping portion gets a merged value according to the value merge function, and non-overlapping portions are preserved.