As the title says, I am looking for some combinator collect
that collects events emitted at the same time into a list, similar to the one found in Reactive-Banana. So in other words:
collect :: EventStream a -> EventStream [a]
collect [(time1, e1), (time1, e2)] = [(time1, [e1,e2])]
If it does not exist already, how would I implement it? Perusing the source, I don't see some way to read the "time" of an event's occurrence, for example Bacon.Event
class does not seem to record the time of its own occurrence? Should I just use Javascript's native new Date().getTime()
function to mark events ex post facto, and assert events happening within some arbitrary time frame are in fact "simultaneous".