Question: I would some help with this which is to Write all of your functions in a single Haskell file, please make sure they are written

I would some help with this which is to Write all of your functions in a single Haskell file, please make sure they are written in HASKELL. Thanks for the help.

I would some help with this which is to Write all of

Write all of your functions in a single Haskell file, which you will submit via Blackboard. You can load your file into the GHCi interactive system using :1. You do not need to provide a main or other interface. Your functions will be tested by loading them into an interactive session and passing them through HUnit tests. 1. (3 points) Write a function elem' which takes an arbitrary item of an Eq type and a list of the same type, and returns true if the item is in the list and false otherwise. For example: elem' 1 [l -> False elem' 4 [1, 2, 3] -> False elem' 'c' "abc" -> True 2. (3 points) Write a function intersect that takes two lists and returns the intersection of two lists. If either list contains duplicate entries the output may contain duplicates as well (if appropriate). If you function does not produce duplicates, even if they are present, it will earn 2 bonus points. For example: intersect [1] [1] -> [1] intersect [1, 2, 3] [1, 2] intersect [ [1, 2, 3], [1, -> 2], [1, 2] [2, 3] ] [ [1], [2, 3] ] -> [[2,3]] Write all of your functions in a single Haskell file, which you will submit via Blackboard. You can load your file into the GHCi interactive system using :1. You do not need to provide a main or other interface. Your functions will be tested by loading them into an interactive session and passing them through HUnit tests. 1. (3 points) Write a function elem' which takes an arbitrary item of an Eq type and a list of the same type, and returns true if the item is in the list and false otherwise. For example: elem' 1 [l -> False elem' 4 [1, 2, 3] -> False elem' 'c' "abc" -> True 2. (3 points) Write a function intersect that takes two lists and returns the intersection of two lists. If either list contains duplicate entries the output may contain duplicates as well (if appropriate). If you function does not produce duplicates, even if they are present, it will earn 2 bonus points. For example: intersect [1] [1] -> [1] intersect [1, 2, 3] [1, 2] intersect [ [1, 2, 3], [1, -> 2], [1, 2] [2, 3] ] [ [1], [2, 3] ] -> [[2,3]]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!