Implement tail recursive foldLeft"