Infer type of functions with named arguments