

How laziness changes thinking in Haskell - mqt
http://www.newartisans.com/2009/03/functional-yet-lazy.html

======
T_S_
The example given in the article can be addressed by using foldl' instead of
foldr. The issue is discussed in

<http://www.haskell.org/haskellwiki/Foldr_Foldl_Foldl>

A Haskell programmer needs to understand when non-strict evaluation can/should
be avoided. foldr is usually more elegant but sometimes less efficient.

~~~
Deestan
Your link is missing the ' at the end.

<http://www.haskell.org/haskellwiki/Foldr_Foldl_Foldl%27>

------
snprbob86
I've read a whole lot about Haskell, but still haven't fired up ghc for fear
of spending too much time playing with it. This post makes me even more
interesting to play with it, but even more scared that I will like it. I'm
afraid that I will like it because I am afraid I will run into stuff like this
when it is too late.

Unrelated comment: do any other Haskell fans know of a solution or debugging
strategies for this problem?

~~~
felixmar
If you have the spare time think of learning Haskell as a great learning
experience. Haskell's concepts are imho worth your time and are useful to know
when programming in other languages. It is a cliché but i do think learning
Haskell has made me a better programmer.

Haskell's laziness is at times surprisingly cool but will also remain tricky.
I sometimes compare it with lock based multi-thread programming. It can be
done but also requires additional thought.

------
ionfish
There are a number of useful tips in this article about when, and how, to use
strict evaluation in Haskell.

<http://users.aber.ac.uk/afc/stricthaskell.html>

------
noamsml
"Ugh, I'm too tired to learn Haskell. Maybe another day."

That kind of laziness? (I kid, I kid, we all know it's "I'll learn Haskell
only when I have to compute something which requires me to know it. I mean, I
thunk I know it.")

