[Haskell-beginners] Doubts about functional programming paradigm

Imants Cekusins imantc at gmail.com
Mon Dec 14 00:02:24 UTC 2015


> The foldl builds up a very long expression and evaluates it after the
last element of the list is reached (the evaluation is non-strict, or
lazy). If you use foldl' (from Data.List) instead, the calculation is done
per element (the evaluation is strict).

Is it possible to write a wrapping function (if it does not already exist)
which would analyze inputs and apply appropriate fold (foldl, foldl',
foldr, foldr') or safeguard (return Left warning) against following the
10Gb ram route - if this can be avoided?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151214/3faf04d7/attachment-0001.html>


More information about the Beginners mailing list