Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

Write a MATLAB program tointegrate /2 cos(cos.x) dr

Answered: 1 week ago

Question

What is the difference between variable and randomized practice?

Answered: 1 week ago