Functional Reactive Programming

27 thoughts
last posted Sept. 9, 2015, 6:02 a.m.

9 earlier thoughts

1

Why "folding over event streams" makes sense in FRP

I just had a light-bulb go off about why folding over a list would work as a way to deal with events in FRP.

The reason is this - the FRP implementation is conceptually updating the list of events, and recomputing only the part of the list affected by the change (i.e. the tail of the list). However, the fold doesn't keep track of past parts of the list, and the runtime also need only remember the tail of list so it can update it, so those old events in the list can be garbage collected (in theory) since there are no references to them.

17 later thoughts