<p dir="ltr">Thanks. Reading back, this is actually explained on page 14 - sorry for that.</p>
<div class="gmail_quote">On 26 May 2014 11:22, "Daniel Fischer" <<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Monday 26 May 2014, 10:00:33, Derek McLoughlin wrote:<br>
> Reading "Parallel and Concurrent Programming in Haskell", at the bottom of<br>
> page 27 the author wants to force the evaluation of a list of Strings:<br>
><br>
> evaluate ( length puzzles )<br>
><br>
> Why not just<br>
><br>
> evaluate puzzles<br>
><br>
> ?<br>
><br>
> <a href="https://github.com/simonmar/parconc-examples/blob/master/sudoku4.hs" target="_blank">https://github.com/simonmar/parconc-examples/blob/master/sudoku4.hs</a><br>
<br>
Because "evaluate" means "evaluate to weak head normal form", that is, to the<br>
outermost constructor or lambda.<br>
<br>
evaluate puzzles<br>
<br>
would evaluate the list just so far that it is known whether the list is empty<br>
or not.<br>
<br>
To evaluate something completely, one needs to evaluate a value that depends<br>
on the complete structure. Presumably, to determine the length of the list,<br>
one needs to evaluate all paths completely to see whether they lead to a valid<br>
puzzle, hence the evaluation is forced by demanding the evaluation of the<br>
length.<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div>