HasPosition can be thought to provide for each positioned value:
A Span, i.e. the hull of all time points "affected" by the value
A linear function, mapping LocalTime (i.e. Scalar Duration) to global time (Time)
Because the function is linear, the two definitions are equivalent.
New definition:
class HasPosition a where
_era :: a -> Span
_position :: a -> (LocalDuration -> Time)
_era x = (_position 0, _position 1)
_position x l = alerp a b l where (a,b) = _era x
position :: (HasPosition a, Transformable a) => Duration -> Lens' a Time
era :: (HasPosition a, Transformable a) => Lens' a Span
onset = position 0
_onset = _position 0
offset = position 1
_offset = _position 1
-- etc
HasPosition can be thought to provide for each positioned value:
Span
, i.e. the hull of all time points "affected" by the valueScalar Duration
) to global time (Time
)Because the function is linear, the two definitions are equivalent.
New definition: