Functional Programming often has some mechanism for maintaining state, while still encouraging heavy use of pure functions. Pure functions are then used to compute new values which are immediately used in a stateful update. See Clojure Atoms. This may appear to be imperative programming with extra steps, but there are a few advantages to this approach. When functions are written independently from from their supposed stateful update, their code is capable of being reused for other, less committal purposes. A pure function may be used to compute Hypothetical values, which can be used for analyzed without affecting the programs understanding of the world. Similarly, the values that a function produces can be retained as Historical values, allowing for now-vs-then checks without retrofitting code.
Example, a form with colored diffs. [TODO]