Functions Are Containers

Memoization via Representables post

What is the most basic Container type a language can have?

Some people may answer vectors, others would go with hash tables, but in this post Iago Leal de Freitas is arguing in favor of functions.

Yes, functions. Even though they aren’t generally seem as a data structure per se, we will see that most containers are in fact a way to represent a function with a given storage layout. To illustrate this “functions are containers” idea, let’s take a look at an application that tightly couples both concepts: Memoization.

Memoization is a technique for storing values of a function instead of recomputing them each time the function is called. wiki.haskell

~

> Table Lookup (of gathered experience) – 53:32; Graph algorithms (table to graph transformation) page