3 ms·
> Laziness is besides the point, scala (and pretty much every language) can do laziness without monads, it is as simple as if private variable == null, then ini
by ParetoOptimal 5y ago
> Laziness is besides the point, scala (and pretty much every language) can do laziness without monads, it is as simple as if private variable == null, then initialize, and then return that variable on every getter call.
Laziness is also better for composition and local reasoning because you can refactor out any subexpression.