<div dir="ltr"><div dir="ltr">Am Fr., 4. Jan. 2019 um 16:46 Uhr schrieb V.Liepelt <<a href="mailto:V.Liepelt@kent.ac.uk">V.Liepelt@kent.ac.uk</a>>:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
<div dir="auto" style="overflow-wrap: break-word;">
<div><span style="font-size:14px;font-family:Inconsolata">[...] Good point, but this is one of the tradeoffs with laziness. In the case of GHC, will the runtime not eventually free the memory of the second argument and everything it points to? It surely must
 do this one way or another since otherwise laziness would mean that while a process is running it will keep leaking space.</span></div></div></div></blockquote><div><br></div><div>You *will* leak space if you keep an unevaluated argument around for a long time, there is nothing any implementation can really do about it: It can't know for sure if you will eventually throw away that argument or (partially) evaluate it. Sometimes the optimizer (e.g. via strictness analysis) can help, but not in the general case. So making an argument lazier is not a no-brainer, quite the opposite...</div></div></div>