Reactive-banana has a function named stepper
(of type MonadMoment m => a -> Event a -> m (Behavior a)
), which converts an event into a behaviour where the behaviour's value is the value of the last event, or the initial value if no event has occurred yet.
In a talk by Conal Elliott, the name of which I cannot remember, he presents this as being one of the fundamental operations on events and behaviours. However, I cannot find a similar function in netwire. With my limited understanding of netwire, I would expect it to have type:
a -> Wire s e m (Event a) a
- Does netwire have an equivalent function?
- If not, is there any reason why this is not possible?
- Is anything similar possible, i.e. ways of converting events into behaviours?