<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">From: http://en.wikibooks.org/wiki/Haskell/Laziness<br><br><br>Given two functions of one parameter, f and g, we say f is stricter than g if f x evaluates x to a deeper level than g x<br><br>Exercises<br><br>&nbsp;&nbsp; 1. Which is the stricter function?<br><br>f x = length [head x]<br>g x = length (tail x)<br><br><br><br>Prelude&gt; let f x = length [head x]<br>Prelude&gt; let g x = length (tail x)<br>Prelude&gt; f undefined<br>1<br>Prelude&gt; g undefined<br>*** Exception: Prelude.undefined<br>Prelude&gt; <br><br><br><br>So, g is stricter than f?<br><br>Wouldn't both functions need to evaluate x to the same level, *thunk* : *thunk* to insure listhood?<br><br>f x = length [head *thunk* : *thunk*]<br>g x = length (tail *thunk* : *thunk*)<br><br>Michael<br><code></code></td></tr></table><br>