Simple toy implementation of what a functional programming based UI library would work like, we have matured variants of this in the ecosystem (Cycle.js, Moonjs), this just isolates the impl of fn(state)-> view
to make it easier to understand for others since UI dev is considered to be super complicated by most devs I've talked to.
The majority of the work, for rendering the view is handled by snabbdom for sake of simplicity. You can write your own vdom diffing and patching but this just makes it easier to explain the concept instead of throwing a lot of knowledge at once.