support type parameters for functions