[Typing-sig] How to ensure a generic function only accepts args of the same type