TriceratypesPractice ML-style type inference step by step
Work in progress - bugs or suggestions? sfreund@williams.edu
fn x => e lambda
f x application
let x = e1 in e2 let binding
if c then t else e conditional
(e1, e2) tuple
+ - * < > operators
nil empty list
x :: xs cons
fun f x = e; function def
fun f 0 = e1
| f n = e2; pattern match
t1 = int integer type
t1 = bool boolean type
t1 = t2 -> t3 function type
t1 = t2 * t3 tuple type
t1 = t2 list list type
A→B = C→D ⟹ A=C, B=DA*B = C*D ⟹ A=C, B=DA list = B list ⟹ A=Bx=A, C=D ⟹ [A/x]C = [A/x]D