I\'m trying to write a function that accepts a string and a list of tuple pairs. I want to search through the list of tuples, and if the first value in the tuple matches the inp
Just use a simple map combined with a lambda:
searchMe :: (Eq a) => a -> [(a, b)] -> [Maybe b]
searchMe a li = map (\(x, y) -> if a == x then Just y else Nothing ) li
OP your function, as it is, won't work as you are defining your list parameter as (x : xs), which won't enable you to apply operations to elements of the tuple.