concept memoization in category c#

appears as: memoization, memoization
Real-World Functional Programming with Examples in F# and C#

This is an excerpt from Manning's book Real-World Functional Programming with Examples in F# and C#.

We’ll see some trickier examples when we talk about list processing, but we’ll take a detour first, via another important optimization technique: memoization.

10.1.2. Caching results using memoization

Memoization, described as caching the results of a function call, may sound complicated, but the technique is very simple. As we mentioned earlier, most functions in functional programming do not have side effects. This means that if we call a function with the same argument twice, we’ll get the same result.

Listing 10.3. Adding numbers with memoization (F# Interactive)