add function to typeclass