3 ms·
Consider product as a counter-example. With an imperative loop, it's easy to add an early-out condition if zero is encountered. But this is harder to do in a (s
by ridiculous_fish 10y ago
Consider product as a counter-example. With an imperative loop, it's easy to add an early-out condition if
zero is encountered. But this is harder to do in a (strict) functional language.
- Athas 10y agoThis is exactly why lazy evaluation is often described as control-flow. Lazy evaluation permits efficient composition, without doing extra work (although the constant factors become much larger).