5 ms·
Not super familiar either language, how does lazy evaluation promote the use of smaller functions?
by kjeetgill 6y ago
Not super familiar either language, how does lazy evaluation promote the use of smaller functions?
- jokethrowaway 6y agoIn non-lazy languages you would need to implement laziness to manage composing functions and have good performance. An example being take 5 . filter ... If evaluation wasn't lazy you would run take 5, return the result to filter and so on.
- vc8f6vVV 6y agoIn the languages I use (Scala, Ruby) it's already done, Rust is using iterators which are lazy too. None of those languages are "lazy" in Haskell sense.
- layoutIfNeeded 6y agohttps://news.ycombinator.com/item?id=24031945 https://news.ycombinator.com/item?id=24031945