Memoizing results in a cache using Scala macros