3 ms·
Although `foldr` accumulates the result right-to-left, it processes the list left-to-right, which allows it to short-circuit. `reduceRight` processes and accum
by pansa2 7y ago
Although `foldr` accumulates the result right-to-left, it processes the list left-to-right, which allows it to short-circuit.
`reduceRight` processes and accumulates right-to-left, so it doesn’t have the short-circuiting ability of `foldr`.
- skrebbel 7y agoRight! Super clear, thanks :-)