Type inference program for a simple functional language