Question: 1 - Type Inference ( 2 0 points ) 1 ) Suppose we have the following expressions ( we omit some information and we replace

1- Type Inference (20 points)
1) Suppose we have the following expressions (we omit some information
and we replace it with #n, where n is some positive integer).
a : #1 list
b : #2
let c = b :: a
let d =(1, true) :: c
where the last expression type checks without error.
What is the type #1?
What is the type #2?
What is the type of the expression([d])?
2) Suppose we have the following expressions (we omit some information
and we replace it with #n, where n is some positive integer):
a : int list
b : #1
c : #2
let (x,y)= b in (x :: a,[x + y] @ c)
where the last expression type checks without error.
What is the type #1?
What is the type #2?
What is the type of the expression([[x]], c :: [])?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!