Type inferencer for lambda calculus