More practice with types in Typelang: 1. Check this let expression, explain why it is well typed,

Question:

More practice with types in Typelang:

1. Check this let expression, explain why it is well typed, and write its type.(let ((x num 2)) (let ((y num 5)) (+ x y)))2. Check this let expression, explain why it is well typed, and write its type.(let ((x num 2)) (let ((z (num -> num) ) ) (lambda (y num) (+ x y)))) (z 5)3. Check this lambda expression, explain why it is well typed, and write its type.(lambda (x: num y num z: num) (+ x (+ y z)) )4. Check this lambda expression, explain why it is well typed, and write its type. 

5. Check this let expression, explain why it is well typed, and write its type.(let ((f (num -> (num -> num)) (lambda (x : num) (lambda (y : num) (+ x y))))) f)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: