Question: Consider the following ML expressions. Evaluate each expression and write down its value followed by : and its type. For example the value of [
Consider the following ML expressions. Evaluate each expression and write down its value followed by :
and its type. For example the value of ::nil::nil is :int list list. Another example,
nil::nil is :a list list. If the expression is invalid or will cause an error, explain why.
::::::
#::::::
#::::nil, a #a
@
nil::
nil::
hd tl
The following three expressions are function definitions. You are asked to infer the type of each function.
fun f x hd x
fun f x hd x
fun f x hd x :: x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
