As Jake McArthur noted in the comments: “If it’s just a function, then I recommend just using one of the existing memoization packages like MemoTrie or data-memocombinators. They should make it easy.”
As Jake McArthur noted in the comments: “If it’s just a function, then I recommend just using one of the existing memoization packages like MemoTrie or data-memocombinators. They should make it easy.”