


















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!



















let plus (x, y) = x + y;; plus (3, 4);;
(a, b) -> a + b
| (a, b, c) -> a + b + c;;
This pattern matches values of type 'a * 'b * 'c
but is here used to match values of type 'd * 'e
let foo (a, b) = a + b
if grade >= 90 then print_string "You got an A" else if grade >= 80 then print_string "You got a B" else if grade >= 70 then print_string "You got a C" else print_string "You’re not doing so well"