Time remaining:
What is the polytpe determined by ML for each case?

Programming
Tutor: None Selected Time limit: 0 Hours

Please help how to solve this: Write ML function definition for each of the follwoing functions. Try to predict what polytype will infer for each function.Then check your prediction using the ML langauge system.What is the polytpe determined by ML for each case?

a. f(x) = 1

b. f(x,y) = 1

c. f(x) = x

d. f(x,y) = x

e. f(g) = g(1)

f. f(g,x)= g(x)

g. f(g,x,y) = g(x,y)

h. f(g,h,x) = g(h(x))

i. f(g,x) = g(g(x))

Apr 21st, 2015

fn arg => returnValue.SML/NJ gives the above function the type int -> int. In general, the type of a function is written argType -> returnType, which is reminiscent of the way mathematicians describe the domain and codomain of functions in math. In the academic programming languages literature, function types are sometimes be called "arrow types".


Apr 21st, 2015

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Apr 21st, 2015
...
Apr 21st, 2015
May 28th, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer