Functional reactive programming is a niche but interesting way of writing stateful programs, especially games and user interfaces. The basic idea is to implement the user interface as a purely functional program from the history of user inputs to a UI. That UI is recomputed every time user input occurs, automatically using caching to make things efficient. Modern formulations1 [1 I like the FRP Refactored paper at Haskell'16.] generally use some sort of type-theory machinery to ensure that yo...