mapValue

inline fun <W> mapValue(f: (Segment<V>) -> W): Segment<W>

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

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

Parameters

f

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