Memoize Module
Thread-safe memoization with optional TTL.
On .NET uses ConcurrentDictionary{TKey,TValue}.
On Fable uses plain Dictionary (JS is single-threaded).
TTL variants periodically clean up stale entries every 1000 operations.
Functions and values
| Function or value |
Description
|
Full Usage:
Memoize.create f
Parameters:
'TKey -> 'TValue
Returns: 'TKey -> 'TValue
|
Memoizes a function. Cached forever (or until process restart). Function whose results are cached by input key.
|
|
|
Full Usage:
Memoize.withTtl ttl f
Parameters:
TimeSpan
f : 'TKey -> 'TValue
Returns: 'TKey -> 'TValue
|
Memoizes a function with time-to-live. Expired entries are recomputed. Stale entries are periodically cleaned up to prevent unbounded memory growth. Duration before a cached entry expires. Function whose results are cached by input key.
|
|
TDesu.FSharp