map as foldr