Implement `foldLeft`