The updated article was moved here since Medium keeps breaking/removing code snippets.
Functional programming has its roots in lambda calculus, a mathematical concept dating back to the 1930s. That might sound daunting, but it’s really not. Without going into the mathematical theory, these principles will introduce you to some of the wonders of functional programming and its benefits for your software.
Let’s get right into it!
A function is pure if:
In other words, pure functions map inputs to outputs.
The caller and the…