[Haskell-cafe] Ord methods too strict?

Sven Panne svenpanne at gmail.com
Fri Jan 4 16:47:28 UTC 2019


Am Fr., 4. Jan. 2019 um 16:46 Uhr schrieb V.Liepelt <V.Liepelt at kent.ac.uk>:

> [...] 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.
>

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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190104/fc263412/attachment.html>


More information about the Haskell-Cafe mailing list