Module type Fix.TABULATOR

A tabulator is a higher-order function that constructs tabulated functions.

type key

The type of keys.

val tabulate : (key -> 'a) -> key -> 'a

tabulate is a tabulation combinator for the type key. The function call tabulate f produces a function f' that behaves extensionally like f, but is tabulated.

Like memoization, tabulation guarantees that, for every key x, the image f x is computed at most once. Unlike memoization, where this computation takes place on demand, here, the computation of f x for every x takes place eagerly, when tabulate is invoked. The graph of the function f, a table, is constructed and held in memory.