Write Recursive Haskell Function Cannot Use Existing Functions Following Write Function El Q37117168

Write a recursive Haskell function (you cannot use existingfunctions) to do the following:

Write a function elem’ which takes an arbitrary item of an Eqtype and a list of the same type, and returns true if the item isin the list and false otherwise.

For example:

elem’ 1 [] -> False

elem’ 4    [1, 2, 3] -> False

elem’    ‘c’ “abc” -> True


Solution


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.