[pro] best practices on type safety of/for generic functions