I'm trying to write a function that takes 2 parameters, the second parament takes a list of tuples. The pair of tuples gets deleted if first component is equal to the first parameter.
eg myDelete 2 [(1, 'a'), (2, 'b'), (3, ’c’)] = [(1, 'a'), (3, ’c’)]
Here is what I have tried
myDelete :: Eq a => a -> [(a, b)] -> [(a, b)]
myDelete a [] = []
myDelete a ((l, r) :xs) | a==l = myDelete a xs
| otherwise = l: r:(myDelete a xs)