4 ms·
This has nothing to do with laziness, because laziness does not affect the semantics of a program that has bounded recursion. [0] The problem is that the quote
by nhaehnle 13y ago
This has nothing to do with laziness, because laziness does not affect the semantics of a program that has bounded recursion. [0]
The problem is that the quoted part of the article is written as if the >>= operator had side-effects (whether lazy or not), and that's just plain false.
Now I agree that ordinarily, a student of Haskell has learned very early on that There Are No Side-Effects in Haskell, and should therefore not be confused. However, introductions to monads typically start out by stating that monads are how you can get side-effects in Haskell, and so they explicitly "deactivate" the No Side-Effects-assumption that students have. That's what causes the confusion.
(In fact, the moment I finally understood monads was precisely when I realized that a useful way of thinking about it is that Haskell code with monads does not have side-effects after all. This is totally obvious in hindsight, but it seems that the best way to get this point across in teaching material has yet to be found.)
[0] Obviously, this is only true in a side-effect-free language, but we're talking about Haskell here...