2018/4/12 Programming Exercise 3 https://canvas.case.edu/courses/6937/assignments/128059 1/2 Programming Exercise 3 Due Monday by 11:59pm Points 50 Submitting a file upload Submit Assignment Haskell Programming Due Monday, April 16 1. Create the function removedups that takes a list and removes duplicate elements. removedups [1,2,2,3,3,3,4,3,4,5,5,5,4,3,3,2,1] => [1,2,3,4,3,4,5,4,3,2,1] 2. Create a continuation passing version, removedupscps removedups_cps [1,2,2,3,3,3,4,3,4,5,5,5,4,3,3,2,1] (\v -> v) => [1,2,3,4,3,4,5,4,3,2,1] 3. While Haskell is similar to Scheme, Haskell’s type rules prevent us from writing a function like the * functions of the first Scheme homework. For example, we can’t write the equivalent of (removedups* ‘(1 1 1 3 3 (4 ((5 5) ())) 6 6 6)) because a list can’t contain both int types and list types as elements. You will fix this by creating the following type. Create a type that allows us to have nested lists. Your type should have two kinds of values, elements and sublists. For example, the following will be a valid list: [Element 1,Element 3,Sublist [Element 4,Sublist [Sublist [Element 5],Sublist []]],Element 6] 4. Create the function gremovedups that takes a list containing elements and sublists and returns a list with the same structure, but if any “element” is preceded by an identical element, that element is removed. gremovedups [Element 4,Element 4,Element 5,Sublist [Element 6,Element 6,Sublist[Element