Why not `foldr` instead of using `++` in every iteration?