Poor man's FRP implementation for Concur. I am experimenting with the smallest possible amount of FRP which can still be useful. A Widget can be considered to be a one-shot Event. (There is no stream of events in Concur). Signals then are never-ending widget loops that allow access to their last return value. This last produced value allows composition with other widgets even for never-ending widgets.
Loop a signal so that the return value is passed to the beginning again.
Folding signals. Similar to how signals used to work in Elm.
This can be used to implement simple stateful Signals.
counter = fold (\n _ -> n+1) 0 clicks