Type checker for simply typed lambda calculus.