type function