Cache2<'a, 'b, 'c>
Cache represents a cached function which can be
invoked and revoked. invoke increments the reference
count for a specific argument (possibly causing the
function to be executed) whereas revoke decreases the
reference count and removes the cache entry whenever
the reference count is 0.
Constructors
Constructor | Description |
new(scope, f)
Signature: (scope:Scope * f:('a -> 'b -> 'c)) -> Cache2<'a,'b,'c>
|
|
Instance members
Instance member | Description |
Clear(remove)
Signature: (remove:('c -> unit)) -> unit
|
Clear removes all entries from the Cache and
executes a function for all removed cache entries.
this function is helpful if the contained values
are (for example) disposable resources.
|
Invoke(a, b)
Signature: (a:'a * b:'b) -> 'c
|
invoke returns the function value associated
with the given argument (possibly executing the function)
and increases the associated reference count.
|
Revoke(a, b)
Signature: (a:'a * b:'b) -> 'c
|
revoke returns the function value associated
with the given argument and decreases its reference count.
|