Call-by-need
An evaluation strategy where function arguments are not evaluated until they are actually needed, and the result is cached for later references.
Call-by-need is the "smart" variant of lazy evaluation: an expression is evaluated only when its value is required (e.g., for printing or comparison), and the result is then cached to avoid recomputation. It differs from call-by-name, which would re-evaluate the same expression each time it's referenced. Haskell uses call-by-need, enabling work with infinite data structures: you can write a list of all prime numbers and just take the first hundred.
The opposite strategy, call-by-value (evaluate before the call), is standard in most imperative languages like C, Java, and Python because it's faster and more predictable for side effects. This choice drastically affects which algorithms are practical and how code is written—call-by-need makes certain mathematical expressions trivial while call-by-value makes them impossible. It's a fundamental decision that ripples through an entire language's design.