Fazendo algum cálculo básico usando Banana Reactiva

Configuração:

Estou usando o Reactive Banana junto com o OpenGL e tenho um equipamento que quero girar. Eu tenho os seguintes sinais:

bTime :: Behavior t Int -- the time in ms from start of rendering
bAngularVelosity :: Behavior t Double -- the angular velocity
                                      -- which can be increase or
                                      -- decreased by the user
eDisplay :: Event t ()     -- need to redraw the screen
eKey :: Event t KeyState   -- user input

Por fim, preciso calcularbAngle que é passado para a função de desenho:

reactimate $ (draw gears) <
reactimate $ (draw gears) <$> (bAngle <@ eDisp)
gt; (bAngle <@ eDisp)

O ângulo é fácil de calcular:a = ∫v(t) dt

Questão:

I pensar o que eu quero fazer é aproximar essa integral comoa = ∑ v Δt para cada evento eDisplay (ou mais frequentemente, se eu precisar). Esta é a maneira correta de fazer isso? Se sim, como obtenhoΔt debTime?

Veja também: Eu suspeito que a resposta usa omapAccum função. Se sim, por favor veja tambémminha outra pergunta também.

questionAnswers(2)

yourAnswerToTheQuestion