I like the new scalaz Memo functionality but find it lacks 2 things: 1) it hides the underlying Map, which I need access to--at least a List of all the values, and 2) I want a version that's implemented using a val scala.collection.concurrent.TrieMap, which I read somewhere is preferable than a var Map.
I'm not yet an implicit wizard. Is there a way to pimp this Memo class to add versions that support this capability or am I going to have to cut/paste into a distinct, new class?
This can be accomplished with the built-in Memo.memo function. Memo.memo creates a Memo instance from a function F => K => V. This also lets you get access to the underlying trie easily. For example: