Hi all, I think this (#3 below) is where I got the idea: http://en.wikipedia.org/wiki/Lazy_evaluation Excerpt: --------------- Lazy evaluation refers to how expressions are evaluated when they are passed as arguments to functions and entails the following three points:[1] 1. The expression is only evaluated if the result is required by the calling function, called delayed evaluation.[2] 2. The expression is only evaluated to the extent that is required by the calling function, called Short-circuit evaluation. 3. the expression is never evaluated more than once, called applicative-order evaluation.[3] --------------- So, I guess #3 doesn't apply to Haskell, or maybe I just misunderstood the meaning of the statement. I assumed that if f(p) = q (by some calculation) then that calculation would be replaced by q so the next time the function was called it could just return q, as occurs in memoization. Michael --- On Tue, 12/15/09, Gregory Crosswhite <gcross@phys.washington.edu> wrote:
|