4 ms·
> want to fold an operator with short-circuiting behavior left-associatedly over a list And then you'd find out that it doesn't work the way you hoped it would
by 08-15 7y ago
> want to fold an operator with short-circuiting behavior left-associatedly over a list
And then you'd find out that it doesn't work the way you hoped it would. foldl always traverses the whole list, because there is no way for it to see that arbitrarily nested applications of the operator would still return the absorbing first argument.
If you need short-circuiting and left-associated traversal, you have to implement an improved fold. Oleg did, and called it iteratee.