Being rather new to pure functional programming idiom, I can’t get how to implement this case of dynamic programming. I have a function f :: String -> [String] which is calculated recursively and want to memoize it. Input Strings can be arbitrary, so I guess that something like a lazy Map is needed, but couldn’t find any. How to implement such case in Haskell?
Being rather new to pure functional programming idiom, I can’t get how to implement
Share
Use a memoizer library:
See the documentation for more. Also see MemoTrie