4 ms·
I’m not much of a haskeller, but friends’ war stories indicate that laziness leaks quite a bit.
by vnorilo 7y ago
I’m not much of a haskeller, but friends’ war stories indicate that laziness leaks quite a bit.
- tome 7y agoAha, yes! You are right. But then so does strictness. See https://augustss.blogspot.com/2011/05/more-points-for-lazy-evaluation-in.html https://augustss.blogspot.com/2011/05/more-points-for-lazy-e... for some examples. Laziness is a definitely a double-edged sword, with sharp edges.
- whateveracct 7y agoThunk leaks happen, but they aren't that scary. They all pretty much have one of a handful of root causes. It's definitely a wart of laziness, but it's also pretty easy to avoid. As far as abtraction goes, laziness doesn't leak. In fact, it's a big reason Haskell performance composes. The head . sort example is contrived, but it holds true in more complicated & useful examples as well!