

What is a calculation?
Aug 5, 2019
Dive into the fascinating world of calculations as pure functions in functional programming. Discover how they differ from traditional mathematical functions and why viewing them as timeless simplifies understanding. Explore the idea of calculations as first-class objects, enhancing the power of higher-order functions. This engaging discussion shines a light on the advantages of transparency in programming, leading to better testing and comprehension.
AI Snips
Chapters
Transcript
Episode notes
Defining Calculations
- Calculations are runnable code that doesn't depend on when or how many times they run.
- They resemble mathematical functions, consistently producing the same output for given inputs.
Calculations vs. Functions
- Calculations are not always functions in programming languages.
- Addition, for example, is often an operator, not a function, yet it's a pure calculation.
First-Class Calculations
- Represent non-first-class calculations (like operators) as first-class objects.
- This enables using them with higher-order functions for greater flexibility.