Hindley Milner Type Checking Algorithm