Switch to foldr.