Closed
Description
The current implementations of foldl (and similar routines) rely on tail call recursion, but currently they blow the stack when operating on arrays that are too long. This can be fixed by optimizing tail calls to re-use their current stack frame.
I think an explicit construct for enabling the optimization is better than applying it for all tail calls, because then you preserve stack traces in the majority of cases where the optimization is not required.