Haskell memoization library using
-XTypeFamilies based off of research by Simon Peyton Jones, Oleg Kiselyov, and Chung-chieh Shan. In fact, the
Memo typeclass and a few instances (
List) come directly from thier examples.
import Data.Recall -- actual function to be memoized f :: [Maybe Bool] -> Maybe Bool f n = fmap and . sequenceA -- function that lazily populates and accesses a lazy trie holding the results of past calls f' :: [Maybe Bool] -> Maybe Bool f' = memoize f