3 ms·
The common argument goes that "laziness is not the best choice for all problems, but defaulting to it forces you to make some hard decisions (referential transp
by kqr 4y ago
The common argument goes that "laziness is not the best choice for all problems, but defaulting to it forces you to make some hard decisions (referential transparency, immutability, controlled effects, control structures as first-class citizens) that are beneficial for a large class of problems."
In other words, you don't necessarily want laziness for its own sake (though sometimes you do) but you do want it for its second order benefits.
Could you get those benefits without laziness? Yes, you could. But in the history of programming languages that has happened very rarely, because under strictness it is very easy and tempting to sneak in a little mutability or uncontrolled effects. Under laziness you can't get away with that.
- galaxyLogic 4y agoBut I thought you can write mutable code also in Haskell, no?