typo here:
seq (f, Maybe df) (g, dg) t
s/Maybe/Just/and `par` should be
par :: Anim a -> Anim b -> Anim (a, b)
par (f, df) (g, dg) = (\t -> (f t, g t), max <$> df <*> dg)
---i'm not sure about `par` - if my understanding of Anim is right, it'll take the shorter animation over its specified duration. what if it was something like:
par a@(_, da) b@(_, db) = (ab, max <$> da <*> db)
where ab t = (a `at` t, b `at` t)
at :: Anim a -> Duration -> a
at (f, Nothing) t = f t
-- freeze when t exceeds dur, i.e. the animation is done
at (f, Just dur) t = f (min dur t)
might be less elegant but i'd expect the combinator to respect an animation's duration.or is that not what the duration represents? i.e. is this correct:
stretch :: Float -> Anim a -> Anim a
stretch factor (f, dur) = (\t -> f (t / factor), (factor *) <$> dur)