uniq in terms of foldr