mapInterval

inline fun mapInterval(f: (Segment<V>) -> Interval): Segment<V>

Create a new segment with the same value, on a new interval derived from this segment.

In most cases using withNewInterval will result in simpler-looking code.

Parameters

f

a function that takes this as argument and produces a new interval.