map2Values
(DOC) A simplified version of map2Values for operations that don't change the timeline type.
(DOC) Performs a local binary operation between two segment-valued timelines.
The operation will be evaluated on each pair of segments that overlap, with their intersection supplied as the interval argument to the operation. The result of the operation is inserted in the result timeline at that intersection.
The binary operation may return null
, which indicates that the result profile should have a gap.
The operation is "local", meaning that while the operation is allowed to know when it is being evaluated, it is not allowed to change where the result segment should be placed. For that, consider using unsafeMap2 or (ideally) shifting the results in a separate operation.
Return
a new timeline of segments
Parameters
the other operand's payload type
the result's payload type
the result's timeline type
the result timeline's constructor
the other operand timeline
a binary operation between the two payload types that produces a maybe-null result