[][src]Module moxie::memo

Moxie implements "topological memoization" with storage in its runtime.

TODO expand on this.

Functions

memo

Memoizes init at this callsite, cloning a cached Stored if it exists and Arg is the same as when the stored value was created.

memo_with

Memoizes the provided function, caching the intermediate Stored value in memoization storage and only re-initializing it if Arg has changed since the cached value was created. Regardless of prior cached results, with is then called in to produce a return value.

once

Runs the provided expression once per topo::Id. The provided value will always be cloned on subsequent calls unless dropped from storage and reinitialized in a later Revision.

once_with

Memoizes expr once at the callsite. Runs with on every iteration.