Question: please help me with this exercise using Haskell (c) Function find takes an element and a list as input, and returns the index of the
please help me with this exercise using Haskell (c) Function find takes an element and a list as input, and returns the index of the first oc- currence of the element in the list (the index of the first element is o), and return -1 if the element is not in the list. Examples: find 5 (1,3,5,6,2,5,7) - 2 find 5 [1,2,4,7) - -1 (a) Function reduceList:: (a -> a -> a) -> [a] -> a takes two inputs, the first one is a function that takes two inputs and generate an output, all of type a, the second one is a list whose elements are of type a, and reduces the list using the function. Examples: reduceList (-) (8,3,1) - (8-3)-1 - 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
