Functions to manipulate ranges

Currently there are no methods to transform or combine ranges. Either you need to manually create a new range instance by coping all parameters, including the step of the IntProgression, even if the step didn’t change, either you need to unfold a range into an Iterable and use methods from there, but it’s not resource-efficient.

E.g.:
(1..5).shift(1)
result: 2..6
(1..5).intersect(3..8)
result: 3..5

3 Likes