[Haskell-cafe] generalized, tail-recursive left fold that can finish tne computation prematurely