Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here is a function definition in ML: fun whatAml (n, nil) = nil whatAml (0, h:: t) = h :: whatAml(1,t) whatAml (1, h
Here is a function definition in ML: fun whatAml (n, nil) = nil whatAml (0, h:: t) = h :: whatAml(1,t) whatAml (1, h :: t) = whatAml(0,t); (a) Show every step of the evaluation process, give the results obtained by evaluating the following: whatAml (0, [6, 5, 4, 3, 2, 1]) (b) Describe the effect of the function whatAml in general. (c) The language ML provides type inference. What type would be inferred for the function whatAml? Explain your answer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
a To evaluate the function whatAml 0 6 5 4 3 2 1 well go through each step of the evaluation process Step 1 Pattern matching with the first case whatAml n nil nil does not match because the second arg...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started