
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Homework 3 CS360 Spring 2005
DUE: May 16, 2005 6:00pm Hand-in assignment at the start of class or put in my mailbox or under my door.
Objective: To gain a better understanding of type systems and type inference.
Reading Chapter 6
ML Types Explain the ML type for each of the following declarations (a) fun a(x,y) = x + 2 * y; (b) fun b(x,y) = x + y / 2.0; (c) fun c(f,x) = f(f(x)); (d) fun d(x,y,b) = if b(y) then x else y;
Problem 6.21 from Louden.
Use the following parse graph to calculate the ML type for the function fun f(g,h) = g(h) + 2;