nameEQ (a,_) (b,_) = a == b numberEQ (_,a) (_,b) = a == b intEQ a b = a == b mem
ID: 3620058 • Letter: N
Question
nameEQ (a,_) (b,_) = a == bnumberEQ (_,a) (_,b) = a == b
intEQ a b = a == b
member :: (a -> a -> Bool) -> a -> [a] -> Bool
member eq x ys = ...
I am given that to start. I need to do a comparison to see if something exists.
I tried to do something like
nameEQ (a,_) (b,_) = a == b
numberEQ (_,a) (_,b) = a == b
intEQ a b = a == b
member :: (a -> a -> Bool) -> a -> [a] -> Bool
member eq x ys | length ys < 1 = False
| head(ys) == x = True
| otherwise = member(x,tail(ys))
But that doesn't seem to work. Gives me errors. Any help on how to complete this would be great.
Explanation / Answer
Already found my answer.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.