Hi, I expressed Memoization and Memoization Tail Recursive on the functions. I hope something useful.
22 people like thisPosted: 13 years ago by zecl
Sometimes you might wish to memoize a function whose input doesn't have the equality and comparison constraints, or maybe the comparison of your given type is just too slow for what you need. To fix this, you simply provide a function which converts the input into something more fitting as an extra parameter.
7 people like thisPosted: 13 years ago by Rick Minerich
Writing functions that recursively generate lambdas from a given parameter is a useful practice, but things get trickier when you need the output functions themselves to be mutually recursive. This is my attempt at creating a fix-point combinator that transparently handles this requirement. It also gives memoization for free as a side-effect.
7 people like thisPosted: 11 years ago by Eirik Tsarpalis
This is more generic variant of http://www.fssnip.net/c4 if you want to memoize over different functions / code paths that calls the same to-be-cached-code.
6 people like thisPosted: 8 years ago by Tuomas Hietanen
From Löb's Theorem to Spreadsheet Evaluation (memoized), based on http://blog.sigfpe.com/2006/11/from-l-theorem-to-spreadsheet.html
2 people like thisPosted: 7 years ago by NIck Palladinos
Modular memoization within a pure functional setting that is implemented as a convenient computation builder.
91 people like thisPosted: 13 years ago by Nick Palladinos
The snippet shows how to implement reusable memoization function and how to use it to implement efficient Fibonacci number generator using dynamic programming.
6 people like thisPosted: 13 years ago by Tomas Petricek
Helper modules for different kinds of memoize functions.
1 people like thisPosted: 10 years ago by Daniel Fabian (@iceypoi)
This is variant of http://www.fssnip.net/sA that is having a time-out. You may want to use this if you e.g. cache a database query result or other mutable data source.
3 people like thisPosted: 7 years ago by Tuomas Hietanen
A generic, thread-safe version of a MemoryCache based on ConcurrentDictionary, and a memoize function implemented using the MemoryCache.
1 people like thisPosted: 6 years ago by Aaron Eshbach