Functional programming in a nutshell
Before we get into FRP, it's necessary to have basic knowledge about functional programming.
In a nutshell, functional programming is a style of writing code in which we use only pure function calls (including recursion) instead of loops and conditionals, and data is immutable.
Note
Functional programming falls under the criterion of declarative programming. Declarative programming is a style of writing code where we write code to tell the system what we would like to happen instead of how to do it. Some other examples of declarative programming are SQL and regular expressions.
So what is a pure function? A pure function is a function that depends only on its input arguments and that always provides the same output for a particular input. If it reads anything else outside of its scope, including global variables, then it's not a pure function.
Obviously, it's not always possible to make all the functions pure. For example, a function that fetches a web page...