I am still trying to better understand lists and tuples within Haskell, and I have come across a problem that I cannot seem to get.
I have a func with type:
func :: [String] -> [(String,String)] -> Bool
where i am trying to see if every value in the string list is present within our list of string tuples
For example input and output, let's say I call func ["Thomas","Jeff"] [("Thomas", "22"), ("Jeff", "16")] this should return true
Whereas if I try func ["Brian","Jeff"] [("Thomas", "22"), ("Jeff", "16")] this should return false
This is what I have so far:
func:: [String] -> [(String,String)] -> Bool
func [] ((y,z):ys) = True
func (x:xs) [] = False
func (x:xs) ((y,z):ys)
| x == y || x == z = func xs ((y,z):ys)
| otherwise = func (x:xs) ys
Can anyone see where I am going wrong?