[Haskell-beginners] Evaluate function

Kim-Ee Yeoh ky3 at atamo.com
Mon May 26 13:21:36 UTC 2014


On Mon, May 26, 2014 at 5:21 PM, Daniel Fischer <
daniel.is.fischer at googlemail.com> wrote:

> To evaluate something completely, one needs to evaluate a value that
> depends
> on the complete structure. Presumably, to determine the length of the list,
> one needs to evaluate all paths completely to see whether they lead to a
> valid
> puzzle, hence the evaluation is forced by demanding the evaluation of the
> length.
>

To avoid that presumption, you could also write

evaluate $ rnf x

whenever x is an instance of NFData.

The length function strikes me as a kludgy stand-in for rnf when rnf is
really what's meant.


-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140526/43dc69a5/attachment.html>


More information about the Beginners mailing list