Functional-Programming

2025

Pure Functions

Pure Functions

Pure functions are functions that return the same result every time, assuming they receive the same inputs. This is made possible by writing the function to be self-contained, meaning it doesn’t rely on variables outside it’s local scope.

Pure functions do not change the external state of the program. They are great for keeping clean code that is easy to debug, but you can’t write an entire program of pure functions, because it wouldn’t actually do anything.

Read more →