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 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

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!