Closed Rafflesiaceae closed 2 years ago
Thank you for your contribution! Memoizing an argumentless function is a little weird, since one can just store the result without invoking the function again, but I guess it can be useful, for instance when working with some functions that have arguments and others that do not have them.
The implementation so far required functions to have arguments in order to be memoized, as their arguments were wrapped into a tuple which was then hashed and used for lookup in a table.
To support functions without arguments the cache is instead implemented as a simple Option type.