I have this code but it does not do what I want totally, I takes a list of tuples;
[(3,2),(1,2),(1,3),(1,2),(4,3),(3,2),(1,2)]
and gives
[(1,3),(4,3),(3,2),(1,2)]
but I want it to give
[(1,3),(4,3)]
where am I doing wrong? Thanks in advance.
eliminate :: [(Int,Int)] -> [(Int,Int)]
eliminate [] = []
eliminate (x:xs)
| isTheSame xs x = eliminate xs
| otherwise = x : eliminate xs
isTheSame :: [(Int,Int)] -> (Int,Int) -> Bool
isTheSame [] _ = False
isTheSame (x:xs) a
| (fst x) == (fst a) && (snd x) == (snd a) = True
| otherwise = isTheSame xs a