
The difference is what's called "dynamic programming" (an utterly non-intuitive and un-insightful name).
It was meant to be. The name was chosen to be truthful while not revealing too much to a US Secretary of Defense of whom Bellman wrote: "His face would suffuse, he would turn red, and he would get violent if people used the term, research, in his presence. You can imagine how he felt, then, about the term, mathematical." (http://en.wikipedia.org/wiki/Dynamic_programming) Every time I try to imagine this guy having Haskell explained to him my brain refuses to co-operate. The word "programming" here is used in the same sense as in "linear programming" and "quadratic programming", that is, "optimisation". "Dynamic" does hint at the multistage decision process idea involved.