unsafeCast

abstract fun <RESULT : Timeline<V, RESULT>> unsafeCast(ctor: (Timeline<V, RESULT>) -> RESULT): RESULT

(DOC) UNSAFE! Casts this timeline type to another type without changing its contents.

The payload type V must be equal between the two types.

This operation allows you to break the invariants of more specialized timeline types. For example, casting Intervals<Segment<Boolean>> to Booleans without sorting and coalescing the segments could result in an invalid profile. In cases like that, it is better to use flattenIntoProfile or reduceIntoProfile.