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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With