<br><font size=2 face="sans-serif">I'm trying to get a better handle on
eager/strict eval in haskell, and a great way to do this is by building
up from simple exercises to harder exercises.</font>
<br>
<br><font size=2 face="sans-serif">So far I have</font>
<br>
<br><font size=2 face="sans-serif">exercise 1) add the integers [1..10^6]
</font>
<br><font size=2 face="sans-serif">&nbsp; (stack overflows if you do a
naive fold, as described on wiki)</font>
<br>
<br><font size=2 face="sans-serif">exercise 2) find the first integer such
that average of [1..n] is &gt; [10^6] </font>
<br><font size=2 face="sans-serif">&nbsp; (solution involves building an
accum list of (average,listLength) tuples. again you can't do a naive fold
due to stack overflow, but in this case even strict foldl' from data.list
isn't &quot;strict enough&quot;, I had to define my own custom fold to
be strict on the tuples.)</font>
<br>
<br><font size=2 face="sans-serif">anybody got other suggestions, or links
to places where eager eval is required to solve simply stated problems?
or exercises that demystify doing eager IO/eager whatever monad, &nbsp;where
that is required?</font>
<br>
<br><font size=2 face="sans-serif">Also am I correct that the terms eager
and strict can be used more or less interchangeably in this problem space?</font>
<br>
<br><font size=2 face="sans-serif">Tired of this folk wisdom that haskell
is only for the elite because getting around stack overflow from lazy eval
is impossible to teach to newbies.</font>
<br>
<br><font size=2 face="sans-serif">t.</font>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">---</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">This e-mail may contain confidential and/or privileged information. If you </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">are not the intended recipient (or have received this e-mail in error) </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">please notify the sender immediately and destroy this e-mail. Any </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">unauthorized copying, disclosure or distribution of the material in this </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">e-mail is strictly forbidden.</span><br>