
On Fri, Jun 10, 2016 at 1:40 PM, Bart Massey
It's hard for me to imagine relying on getting bottom instead of a result.
Thanks to the presence of extensible exceptions, some people may do things like (foldl' f (throw blah)) and then catch the exception further up. It's terrible, I know. Using explicit continuations would be much cleaner. But still, it is what it is
However, it's also hard for me to imagine relying on foldl' forcing the initial value in the case of folding on an empty list, and in non-empty list cases the folding function is likely going to be strict on the accumulator anyhow.
The main issue I see here is a sort of inference issue. That is, if the initial value to fold' is marked as lazy then we might build up some huge thunk which must in practice actually get forced; whereas if the initial value is strict then we can percolate the knowledge of that strictness further up, potentially evaluating things more eagerly and thus avoiding the overhead of thunking, allocation, etc. -- Live well, ~wren