Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reactive-banana time delays

I have scoured the documentation of reactive-banana, and I can't find a way to specify explicit time delays. Say, for example, I would like to take an Event t a and shift all of its occurrences 1 second into the future; or get an event that fires 1 second from now (within Moment t); or anything like that. Are explicit delays representable in reactive-banana? If not, how do users implement, e.g., echoing input delayed by a second?

like image 517
luqui Avatar asked Oct 29 '13 20:10

luqui


1 Answers

As Ben indicates, this is correct: reactive-banana is no built-in notion of time and delays.

The main reason is that it is hard to guarantee that logical time and real time agree. What happens when a mouse click happens in real time before the logical time of an event which could not yet be calculated, i.e. whose real time dallies behind its logical time?

However, it is still possible to deal with time by using external timer events. Have a look at the Wave.hs example.

like image 172
Heinrich Apfelmus Avatar answered Oct 12 '22 02:10

Heinrich Apfelmus