[reactive] Bounce

Thomas Davie tom.davie at gmail.com
Fri Nov 21 03:14:11 EST 2008

> positionB :: Double -> Behavior Double -> Behavior Double ->  
> Behavior Double
> positionB x0 v t = (x0 +) <$> liftA2 (*) v t

On an unrelated note, I created a package called InfixApplicative,  
because I found that exactly this kind of expression looked ugly in my  
code.  If you import it, you can define this instead:

positionB x0 v t = (x0 +) <$> (v <^(*)^> t)

Hope that helps


More information about the Reactive mailing list