Question: Please answer below! 3. SML functions (a) Write a function double that takes a list as a parameter and returns a list where each element
Please answer below!
3. SML functions (a) Write a function double that takes a list as a parameter and returns a list where each element is repeated. For example, double ([1,2,3])=[1,1,2,2,3,3]. You can use map but it is not mandatory in this question. The function must be tested in an IDE and post the screenshot of your running and tested code (with at least 3 tests). (b) We consider the mc91 function below. fun ma91 (n)= if n>100 then n10 else ma91 (ma91(n+11)); i. What is the map function and its type? ii. What is the result of the evaluation of the following expression? Explain your answer. mapmc91[103,102,101,100,99,98,97,96]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
