Simplifying the type checking of function call