types through polymorphic functions