Beginner's question: Memo functions in Haskell