Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. What is the type of the following function? fun mystery (xs) - if null xs then else hd(xs) + mystery(t1 xs) (1 point) This
4. What is the type of the following function? fun mystery (xs) - if null xs then else hd(xs) + mystery(t1 xs) (1 point) This function will not typecheck 'a list -> int int list -> int int * int -> int 5. Given the following ML statement, what is f bound to? val (e, (f,)) = (1,(2,3)); (1 point) 6. Given the following ML statement, what is a bound to? val (a,b) (5,6); (1 point) 7. What is ans bound to after the following ML code is evaluated? fun m2 lst let fun loop (1st1, 1st2) = case 1sti of [ ] => 1st2 |x::[ ] => X:: 1st2 | x::( ::z) => loop(z,x::lst2) in loop(1st,[ ]) end val ans = m2 [4, 3, 2, 1] (1 point)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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